I'm having some major issues with printing PDF's. I've already spent at least 5 hours looking for a way to make this work, and am extremely frustrated. Basically, what I'm doing is initially loading the PDF at 72 dpi (PdfDpiRendering = 72). I'm doing this for speed.
- Code: Select all
oGdViewer.PdfDpiRendering = 72
oGdViewer.DisplayFromPdfFile (Me.TxtFilepath)
If the user decides to print the PDF, it changes the dpi to 300, then reloads the image, then prints.
- Code: Select all
oGdViewer.PdfDpiRendering = 300
oGdViewer.DisplayFromPdfFile (Me.TxtFilepath)
oGdViewer.PrintSetFromToPage 1, oGdViewer.NumPages
oGdViewer.PrintImage
The problem is, it does absolutely nothing relating to printing 95% of the time. It reloads the image no problem, but it seems like it skips the print command. When it does decide to print (usually the first time I send the print command), it prints at the 72 dpi, so the print quality is terrible. If I take out the reload code, it still does not work. If I take out the PrintSetFromToPage command, it prints every time, but obviously only prints the 1st page. The only way I have gotten it to work is with this code:
- Code: Select all
For i = 1 To oGdViewer.NumPages
oGdViewer.DisplayFrame (i)
oGdViewer.PrintImage
Next i
The problem with this code is that it separates it into multiple print jobs, and cycles through the pages on the viewer, making it extremely slow & inefficient to print. Printing 50 pages takes 20 minutes on my 40 page per minute laser.
What am I doing wrong??
