Do you own a Debenu Quick PDF Library version 7, 8, 9, 10, 11, 12, 13 or iSEDQuickPDF license? Upgrade to Debenu Quick PDF Library 14 today!
PrintDocument Blank Pages |
Post Reply |
Author | |
skwirelboy
Team Player Joined: 27 Feb 06 Status: Offline Points: 45 |
Post Options
Thanks(0)
Posted: 26 Mar 07 at 11:51AM |
HI,
Delphi user. I am using PrintDocument to print pages from a pdf.
The pdf is loading fine (I can save it to another file), but when I call
QP.PrintDocument((Printer.Printers[Printer.PrinterIndex], 1, QP.PageCount, 0)
It prints the correct number of pages but they are all blank.
I assume this has something to do with rendering to the page and GDIPlus, but what?
I am printing to a network printer.
Anyone able to give me some pointers please?
Thanks
Mark
|
|
marian_pascalau
Debenu Quick PDF Library Expert Joined: 28 Mar 06 Location: Germany Status: Offline Points: 278 |
Post Options
Thanks(0)
|
Are you sure that your library is unlocked?
If yes use a free PDF or XPS (Vista/XP) driver to print your document in file. Open the result file and tell us if it's working.
If it doesn't then send your pdf file to support(at)quickpdf.org and I will send the printout (as PDF or XPS) back to you.
|
|
skwirelboy
Team Player Joined: 27 Feb 06 Status: Offline Points: 45 |
Post Options
Thanks(0)
|
Hi, The library is unlocked. I am able to load the pdf to an instance of quickpdf and save it with another filename.
The pdf prints fine using acrobat. Where can I fond free PDF drivers?
Have posted pdf document to quickpdf.org.
Many thanks
Mark
|
|
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3524 |
Post Options
Thanks(0)
|
Hi Mark!
Try FreePDF or PDFCreator. My first choice is FreePDF. Best regards, Ingo |
|
skwirelboy
Team Player Joined: 27 Feb 06 Status: Offline Points: 45 |
Post Options
Thanks(0)
|
Hi Ingo,
Presumably, I should not need either of these tools to print a document using PrintDocument function of QuickPDF. Have you any idea why the PrintDocument function is printing the correct no of pages but they are all blank. My app is on a win XP machine trying to print to a network printer.
Thanks
Mark
|
|
ukobsa
Senior Member Joined: 29 May 06 Location: Germany Status: Offline Points: 115 |
Post Options
Thanks(0)
|
Mark,
I just took a quick look on your sample: I was also not able to render it on screen (using QuickPDFs rendering methods). Well, this needs some more debugging. btw: which version of QuickPDF are you using? Ulrich |
|
marian_pascalau
Debenu Quick PDF Library Expert Joined: 28 Mar 06 Location: Germany Status: Offline Points: 278 |
Post Options
Thanks(0)
|
Hi Mark, I have tested once your problem. At the moment I can only tell you that there is a problem with font processing. If you try to extract your document text it works without a problem. This is one of the kind problems which I always avoided to solve for free. If requires some kind of Font knowledge and goes deep into theory. If it is for you important please consider sponsoring me to find a solution to your problem or avoid using the same font in your PDF documents.
|
|
skwirelboy
Team Player Joined: 27 Feb 06 Status: Offline Points: 45 |
Post Options
Thanks(0)
|
Hi both,
I can't render it to screen either. I have tried printDocument with a home spun pdf and this works fine.
I have no control over the fonts. I am trying to print pdfs from third parties so I have no say over what font they use. From the looks of it, quickPDF is not the solution for this, which is disappointing. Anyone have any suggestions for something that can reliably print out pdfs?
It's no good me sponsoring someone to come up with a solution for this document in particular. I need somethign that can handle just about any pdf that comes through the door.
I've tried ShellExecute with Acrobat with moderate success, but it is a bit of a pain and I can't seem to get it to print without Acrobat showing.
Regards
Mark
PS I have to say for a format so universally deployed why is it such a pain in the neck to try and even do something as basic as print the damn document.
|
|
chicks
Debenu Quick PDF Library Expert Joined: 29 Oct 05 Location: United States Status: Offline Points: 251 |
Post Options
Thanks(0)
|
It's possible with Reader 7, but I haven't been able to keep it from showing with Reader 8. See my site for pdfp, and some commercial printing options (in the comments section): PDFTools |
|
skwirelboy
Team Player Joined: 27 Feb 06 Status: Offline Points: 45 |
Post Options
Thanks(0)
|
Thanks for info. Downloaded pdfp. Tried out commandline app. It's got the same problem as I've found with ShellExecute (assume this is what you are using) ie it leaves an Acrobat window open. I understand this is a bitch to work around. Thanks any way.
|
|
chicks
Debenu Quick PDF Library Expert Joined: 29 Oct 05 Location: United States Status: Offline Points: 251 |
Post Options
Thanks(0)
|
Really? Which version of Acrobat/Reader? |
|
skwirelboy
Team Player Joined: 27 Feb 06 Status: Offline Points: 45 |
Post Options
Thanks(0)
|
8
|
|
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3524 |
Post Options
Thanks(0)
|
Hi!
Because of the still open window... I can't test it now but perhaps this behavior doesn't appear if you're calling the pdf via browser? Makes "iexplore sample.pdf" a difference? I don't know if printing is possible via shellexecute and browser ;-) Best regards, Ingo |
|
chicks
Debenu Quick PDF Library Expert Joined: 29 Oct 05 Location: United States Status: Offline Points: 251 |
Post Options
Thanks(0)
|
OK, Adobe changed the classname with 8, so I had to rewrite pdfp to use the new classname. Pdfp8 is the result. Reader 8 insists on making itself visible while printing, but Pdfp8 should close Reader 8 when done printing. |
|
skwirelboy
Team Player Joined: 27 Feb 06 Status: Offline Points: 45 |
Post Options
Thanks(0)
|
Hi Chicks,
Thanks for this, but because of the fact that Acrobat is a pain in the a**e, I have spent the morning working with Ghostscript. It seems not to have any difficulties dealing with any pdfs I can throw at it and it is very fast. However its command line switches are a bit of a pain. Do you or anyone else on this forum have experience of Ghostscript on the command line.
Thanks
Mark
|
|
chicks
Debenu Quick PDF Library Expert Joined: 29 Oct 05 Location: United States Status: Offline Points: 251 |
Post Options
Thanks(0)
|
If you actually have Acrobat, there are low-level APIs that will let you print easily without any GUI, using Adobe's SDK. If you only have Reader, yes, it's impossible to work around Adobe's splash screens.
If you are printing to PostScript printers, there are a couple of things to do that are easier than GhostScript. First, if you're luck enough to have a PDF Direct PostScript printer, you can send PDF directly to it for printing. If it's a more ordinary PostScript printer, the best thing I've found is to use pdftops (part of Xpdf from foolabs) to convert the PDF to PostScript, then a utility like rawprint or PrintFile to print it. Ghostscript is great, but as you say, a bit of a pain to set up. Govert has some Ghostscript GUI stuff here, that may help: Govert's Tools Also have a look at Russel Lang's GSPrint, which is a commandline GhostScript front end for printing PS/PDF files: GSPrint Edited by chicks - 29 Mar 07 at 10:24AM |
|
skwirelboy
Team Player Joined: 27 Feb 06 Status: Offline Points: 45 |
Post Options
Thanks(0)
|
Thanks for the speedy response. We do use postscript printers and we have designed a java utility to convert pdf to postscript so that we can send different pages to different printer trays. But this conversion is slow and where we do not need to convert to postscript (ie when the whole document can be printed from a single tray) I would just wish to send a pdf direct to the printer. Ghostscript can handle this and prints very quickly. I am having problems with the sOutputFile option. I cannot seem to get GS to recognise the windows printers I pass in via this option. I am sure I have missed something basic, but I just can't find it.
If you have any experience of this I would be very grateful for any tips.
Thanks.
But I now want a utility
|
|
chicks
Debenu Quick PDF Library Expert Joined: 29 Oct 05 Location: United States Status: Offline Points: 251 |
Post Options
Thanks(0)
|
Hmmm, it's been a long time since I used GS under Windows, but IIRC I had to use Redmon to set up a "virtual" printer. Maybe it's not required for what you're doing, but you might find some setup hints in its help:
Redmon Edited by chicks - 29 Mar 07 at 10:59AM |
|
chicks
Debenu Quick PDF Library Expert Joined: 29 Oct 05 Location: United States Status: Offline Points: 251 |
Post Options
Thanks(0)
|
Been playing with this, I'm not sure how GS could be faster than pdftops, since GS also has to convert PDF to PS in order to print to a PS printer.
Anyway, here's the easiest possible way I can come up with to commandline print a PDF in Windows: pdftops mypdf.pdf tmp.ps lpr -S 123.456.789.10 -P "My Postscript Printer" tmp.ps Lpr is a *nix tool that's installed on Windows since at least W2K. -S is ip address or hostname of your print server, -P is the printer name on that server. |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |
Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. About — Contact — Blog — Support — Online Store