Link to home
Start Free TrialLog in
Avatar of keepliving
keepliving

asked on

Creating a PDF file with ghostscript, redmon and a virtual postscript printer

Hi,

I have been reading about creating pdf files using ghostscript, redmon and a post-script printer.  Does anyone how to put all three of these together?  People seem to be saying that the steps are:
1) install ghostscript
2) install redmon
3) setup a virtual printer (postscript with the out being redirect by redmon to a custom exe)
4) whenever you would like a pdf document just print to the virtual printer

The custom exe takes the postscript printer's output and coverts it into pdf via ghostscript.  

Basically I need to create a pdf document based on MS Word documents.  Since the user will be creating the files in Word, I was hoping to print the document to the virtual printer, timestamp it and place it into a protected directory (all through code).  This would save a great deal of time for them.    

So does anyone have a site, insight or code that does the custom exe part?  Unfortunately, I have no idea how to work with printer spools or whatever is at work here.  I can't use any of the free pdf printer driver applications since they all require the user to give a file name or set some other settings (for example www.primopdf.com that comes with C++ source code).

Hopefully some can help out, but thanks for reading, participating and maybe helping.


PS: If someone has a solution with full code, I would be more than willing to double the points or maybe pay a little through paypal (if it is allowed).

Some links of relevance:
http://www.cs.wisc.edu/~ghost/
http://www.cs.wisc.edu/~ghost/redmon/index.htm
http://www.primopdf.com/ (free source code available in C++)
http://kenchiro.tripod.com/howtoPDF.html
http://home.hccnet.nl/s.vd.palen/index.html

Avatar of JR2003
JR2003

There is an open source GNU General Public License (GPL)  project called PDFCreator which is written in VB and does what you want.
http://sourceforge.net/projects/pdfcreator/

Also worth a look is CutePDF which is free an allows you to save any windows document that can be printed, including MS-Word documents, as a PDF file.
http://www.cutepdf.com/
Avatar of keepliving

ASKER

Hi JR2003,

I saw that project as well as the iText ones and was worried about the number of bugs those one had.  Seeing that the other programs due the redmon trick, I thought it might be safer than what these guys are doing.  Was this incorrect thinking?

CutePDF will not allow me to programmatically set the parameters for file name and such without buying the more expensive licensing.  It is very much like pdf995 or primopdf in these terms.

Thanks for the reply and suggest.
I think it will be a great deal lot of effort to write something like that yourself and printer drivers are notoriously difficult to debug. I think you will save money, time and a lot of headaches if you just buy one of the licences that allows royalty free distribution. The license is then only a one off  cost.
Hi,

I downloaded the source for PDFCreator and have started to take a closer look at it.  It is a lot of work that they have put in!    

A printer spooler and properties window with lotz of settings associated to the output.  Very impressive actually in terms of the amount of functionality work they have put into.  Yet they still use redmon.  I might be taking on too much here.  I can't do this type of coding.

Regarding, licensing an existing product.  That just would not be possible.  The usual story, either make it work and get little recognition or don't and have the end user complain and moan for the extra steps they have to go through until it is finally ignored or dropped. Not complaining, just the usual story.

Thanks for the feedback, I guess I am hoping that someone has done this already or something.

If you intend on using this on a client then you can install a postscript printer, any will do I use an HP8100. Save the file with a '.ps' extension then run GhostScript on it.

I have some source for automating the GhostScript piece as well as here is the link to GhostScripts site with some examples of using the api - http://www.cs.wisc.edu/~ghost/doc/gsapi.htm

It also wouldn't be that hard to set up a "watched folder" and run it all automaticaly if that is where you are headed.

ampapa,
Hi Ampapa,

The piece that puzzles me is how can I take the printer feed via RedMon and pass it into my vb app so that it will create the pdf file.  

The gsapi did not really go into how to use a virtual printer did it?  It looked more like how to call the ghostcript command lines for ps2pdf after a file has been printed to a ps file.  But what if someone prints two documents, one right after the first, wouldn't the ps file get overridden or have access denied or something?  Or am i completely lost?

I don't know about the watched folder idea, since I would rather pass the filename when I print to the virtual printer.  This way, I can do many print jobs one at a time and not worry about managing jobs that in the que or took longer to print then others.  Know what i mean?

Do you have some source as how to do this using Redmon?  If so, can i get it off of you at a reasonable price, please?

Thanks for replying.
ASKER CERTIFIED SOLUTION
Avatar of ampapa
ampapa

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial