Andries, >At this moment we are drawing lines, images and text to a printer's canvas or onto a screen canvas. Customers could create pdf files bij printing to pdf via an installed pdf printer (like the pdf995 or novapdf 'printers' etc). > >Customers are now asking to be able to create directly a pdf file from within the application without having to select or even install a pdf-printer (or setting this printer to be a default). I presume they do not have acrobat installed. > >Does anyone have some experience on what components for delphi 7 are available to be able to create pdf files? Best and easiest for use should be if we could convert the drawing onto the screen.canvas to a pdf.canvas...
I do not know of a component that writes PDF files. You can write your own code to generate PDF files using the PDF specifications. The PDF format was recently submitted to ISO for standardization: http://www.adobe.com/devnet/pdf/pdfs/ISOFormatting_070604C.pdf A very easy way to deal with this is to use PDF Creator, free, open source software that installs as a printer driver, like many others. It actually uses Ghostscript, another free, open source project (more on that later). The feature that makes PDF Creator different than other PDF printer drivers I have seen is that it can be configured to automatically write the PDF file to a configured path and a generated file name. While most PDF drivers pop up a dialog asking the user for the name of the PDF file, PDF Creator can be configured so this is transparent to the user. PDF Creator is written in Visual Basic and the source is available, so you could figure out how they did this and write embedded code that does the same thing. However, Ghostscript would still need to be installed. http://sourceforge.net/projects/pdfcreator/ Ghostscript can be used to convert a Postscript file to a PDF file, using command line programs. http://sourceforge.net/projects/ghostscript/ Here is a Postscript reference: http://www.adobe.com/products/postscript/pdfs/PLRM.pdf If you have a limited number of features you need to produce in your PDF files, you can simply install a Postscript printer driver (there are many that ship with Windows), and print samples using the Print to File option. You can then examine the output file with an editor to see what kind of Postscript was generated. Your program would write a text Postscript file, then execute the Ghostscript command line programs to convert to a PDF. There are straightforward ways to use a single machine on a network to act as a PDF server. This would allow all the machines running your software on the network to create PDF files using the server machine (with PDF Creator installed), without needing to have PDF Creator installed on each workstation. If you are interested in details, let me know. Glenn Lawler www.incodesystems.com

