I have added the ability to draw an overlay on a PDF page during
viewing and printing.
The approach I am using is to get the bitmap by calling
pdfDraw.GetBitmap, creating a Graphics object, and drawing the
metafile onto the bitmap. I then draw the bitmap to the printer
When I print to a physical printer everything works fine. When I
print to a PDF printer the resulting file is VERY slow, almost appears
to be hung
The slow printing to the software PDF driver it is probably due to the
size of spool file and the fact that the application is printing from
the main application thread (which most likely freezes the GUI).
Because you are rasterizing the entire page there is a large bitmap
that needs to be processed by PDF creation software. You could
probably speed things up by producing a smaller bitmap (i.e. set a
lower DPI). As an alternative, you can also try using GDI+ rasterizer
(pdfdraw.SetRasterizerType(PDFRasterizer.Type.e_GDIPlus))? In some
cases this will result in output that is faster to process by certain
software PDF printer drivers.
Also since you only need to add new content to existing PDF document,
why don't you simply stamp PDF pages directly (see
http://www.pdftron.com/net/faq.html#how_watermark). This will be both
faster and will produce smaller PDF documents that preserve the
original document quality.