Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Creating a virtual printer

Options
  • 04-04-2007 2:19pm
    #1
    Registered Users Posts: 2,931 ✭✭✭


    Hi

    I am looking at developing a virtual printer that implements a web service to our custom document repos. Mainly this will done as a proof of concept which will possibly be implemented enterprise wide. Using a printer allows rather than writing custom addins is probably more deployable.

    I saw this done by the likes of Kinkos and the fax printer on MS.. Any ideas or pointers. I am planning on doing this in .NET 2.0.

    Thanks


Comments

  • Closed Accounts Posts: 1,567 ✭✭✭Martyr


    no idea myself, most virtual hardware i've seen done on windows used a device driver, running in kernel mode.


  • Registered Users Posts: 32,417 ✭✭✭✭watty


    Are you wanting to learn this stuff. Otherwise buy one. There are plenty for PDF and Web page generation.


  • Registered Users Posts: 2,931 ✭✭✭Ginger


    Basically what I am want to do is implement a print function that saves to our online repository and use a custom dialog box that consumes a web service to display fields that can index that document.

    Our web repository is similar to sharepoint but custom written.

    Rather than trying to customise toolbars in every package that could possibly save to this system, implementing a virtual printer would be the ideal solution

    So its a learning exercise.


  • Closed Accounts Posts: 4,943 ✭✭✭Mutant_Fruit


    I am looking at developing a virtual printer that implements a web service to our custom document repos. Mainly this will done as a proof of concept which will possibly be implemented enterprise wide.
    So you want to save PDF files to your server? Thats relatively simple stuff, .NET 2.0 has a fair few classes for uploading files. FtpClient, WebClient, TcpClient and pure sockets.
    Using a printer allows rather than writing custom addins is probably more deployable.
    I dont understand that, sorry :p


  • Registered Users Posts: 2,931 ✭✭✭Ginger


    Never said it was PDF ... its file agnostic to the point of any file that can be printed should be able to be saved in its original format.

    As for the other bit, I think i should drink coffee before I post!


  • Advertisement
  • Moderators, Recreation & Hobbies Moderators, Science, Health & Environment Moderators, Technology & Internet Moderators Posts: 91,696 Mod ✭✭✭✭Capt'n Midnight


    pdfcreator is open source and will print to many image files as well as pdf's
    pdfcreator also can be setup as a network shared printer, so any user can print to it, and the file gets auto named and saved in a common folder.

    if you add a new printer and choose microsoft as the manufacturer you can then choose a generic text only driver, it would be nice to have a variation of it that doesn't ask you for the file name


  • Registered Users Posts: 2,931 ✭✭✭Ginger


    Again not saving as PDF... the idea is fairly simple. User click print and it saves it to an online repos. So if they are in AutoCad it get saves as .DWG, in Word as .DOC etc etc.. No conversion

    I will look at PDFCreater and see if i can get the source on how it creates itself as a printer and work from there


  • Closed Accounts Posts: 4,943 ✭✭✭Mutant_Fruit


    Fine, you don't want a PDF, that's irrelevant really ;) All you want to do is copy "FileX" from a local machine to the interweb.

    I listed several classes which you could use to do that. If you want your website to appear as a "printer" in the standard "print page" dialog in windows, you won't be able to do that in C#.

    Best bet would be to create a form/page that allows you to select either "upload" or "standard printer" and then either upload the file or open the standard printer dialog.


  • Moderators, Recreation & Hobbies Moderators, Science, Health & Environment Moderators, Technology & Internet Moderators Posts: 91,696 Mod ✭✭✭✭Capt'n Midnight


    Ginger wrote:
    Again not saving as PDF... the idea is fairly simple. User click print and it saves it to an online repos. So if they are in AutoCad it get saves as .DWG, in Word as .DOC etc etc.. No conversion
    No conversion means no printing.

    Write a macro in VB to save file, and then copy it to the interweb. You can define a button and assign the macro to it, call it PUBLISH or something.

    Office / AutoCAD have macro support.


  • Registered Users Posts: 2,931 ✭✭✭Ginger


    I dont get the no conversion no printing.

    I cant write macro support for all the apps in the organisation thats the issue.

    I saw Kinkos did something like this before. Its similar to that, but there was possibly a conversion system built in.

    I will take a look at the open source one that sets itself up a network printer and see if I can use that as a base ..

    Thanks for the input


  • Advertisement
  • Registered Users Posts: 304 ✭✭PhantomBeaker


    Ginger wrote:
    I dont get the no conversion no printing.

    Basically, when you're printing, you're not sending the actual source file to the printer, but what the application thinks should be going to the printer.

    For example, take a GIF image. The GIF specification allows for a comment to be embedded into it. If I want to print that, the program will strip out any information that it thinks the printer doesn't want to know. It will strip out any metadata or comments or anything that the printer doesn't need to know to print it.

    Then it will have various control codes appended to it so that the printer can print it as we want it to. At no point does the source file (in this case the raw GIF) go anywhere near the printer. It's interpretted by the host program.

    Another example, again with graphics. Take some program like Photoshop, or the Gimp. Now, let's say you do up a simple picture with 2 layers. What the graphics program does is flatten that down to one image then it goes to the printer (whether it's virtual or not). Once again, the printer will not see the source file. It doesn't know that there aren't layers, it just knows that it's getting some data to print.

    That's what's I'd mean if I said "No conversion, no print", because each and every program will send the printable data to the printer, not its own internal file format. As a result, I don't think (and I could be very wrong on this, so I'm open to correction) that you could put source files in a repository using a virtual printer.

    I mean, it's a nice idea, and I see where you're coming from. You can't edit all the programs to support your repository, but if they supported printing, your idea would just get it there. But the problem is, all those programs that can't be changed to be aware of your system can't be changed to not convert their data as they usually would before they send it off to the printer.

    At least that's my understanding of it. I'd kinda hope I'm wrong, because it's a cool idea.

    Good luck.
    Aoife


  • Registered Users Posts: 2,931 ✭✭✭Ginger


    Well that bit I can understand, I thought it was implied that no conversion meant no conversion to PDF :)


Advertisement