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!

Debenu Quick PDF Library - PDF SDK Community Forum Homepage
Forum Home Forum Home > For Users of the Library > I need help - I can help
  New Posts New Posts RSS Feed - PrintDocument Blank Pages
  FAQ FAQ  Forum Search   Register Register  Login Login

PrintDocument Blank Pages

 Post Reply Post Reply
Author
Message
skwirelboy View Drop Down
Team Player
Team Player


Joined: 27 Feb 06
Status: Offline
Points: 45
Post Options Post Options   Thanks (0) Thanks(0)   Quote skwirelboy Quote  Post ReplyReply Direct Link To This Post Topic: PrintDocument Blank Pages
    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
Back to Top
marian_pascalau View Drop Down
Debenu Quick PDF Library Expert
Debenu Quick PDF Library Expert


Joined: 28 Mar 06
Location: Germany
Status: Offline
Points: 278
Post Options Post Options   Thanks (0) Thanks(0)   Quote marian_pascalau Quote  Post ReplyReply Direct Link To This Post Posted: 26 Mar 07 at 2:40PM
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.
Back to Top
skwirelboy View Drop Down
Team Player
Team Player


Joined: 27 Feb 06
Status: Offline
Points: 45
Post Options Post Options   Thanks (0) Thanks(0)   Quote skwirelboy Quote  Post ReplyReply Direct Link To This Post Posted: 27 Mar 07 at 3:10AM

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
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3524
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 27 Mar 07 at 5:36AM
Hi Mark!

Try FreePDF or PDFCreator.
My first choice is FreePDF.

Best regards,
Ingo

Back to Top
skwirelboy View Drop Down
Team Player
Team Player


Joined: 27 Feb 06
Status: Offline
Points: 45
Post Options Post Options   Thanks (0) Thanks(0)   Quote skwirelboy Quote  Post ReplyReply Direct Link To This Post Posted: 27 Mar 07 at 6:37AM
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
Back to Top
ukobsa View Drop Down
Senior Member
Senior Member


Joined: 29 May 06
Location: Germany
Status: Offline
Points: 115
Post Options Post Options   Thanks (0) Thanks(0)   Quote ukobsa Quote  Post ReplyReply Direct Link To This Post Posted: 27 Mar 07 at 8:19AM
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
Back to Top
marian_pascalau View Drop Down
Debenu Quick PDF Library Expert
Debenu Quick PDF Library Expert


Joined: 28 Mar 06
Location: Germany
Status: Offline
Points: 278
Post Options Post Options   Thanks (0) Thanks(0)   Quote marian_pascalau Quote  Post ReplyReply Direct Link To This Post Posted: 27 Mar 07 at 10:35AM

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.
Back to Top
skwirelboy View Drop Down
Team Player
Team Player


Joined: 27 Feb 06
Status: Offline
Points: 45
Post Options Post Options   Thanks (0) Thanks(0)   Quote skwirelboy Quote  Post ReplyReply Direct Link To This Post Posted: 28 Mar 07 at 12:57PM
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.
Back to Top
chicks View Drop Down
Debenu Quick PDF Library Expert
Debenu Quick PDF Library Expert


Joined: 29 Oct 05
Location: United States
Status: Offline
Points: 251
Post Options Post Options   Thanks (0) Thanks(0)   Quote chicks Quote  Post ReplyReply Direct Link To This Post Posted: 28 Mar 07 at 1:43PM
Originally posted by skwirelboy skwirelboy wrote:


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.



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
Back to Top
skwirelboy View Drop Down
Team Player
Team Player


Joined: 27 Feb 06
Status: Offline
Points: 45
Post Options Post Options   Thanks (0) Thanks(0)   Quote skwirelboy Quote  Post ReplyReply Direct Link To This Post Posted: 28 Mar 07 at 2:08PM

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.
Back to Top
chicks View Drop Down
Debenu Quick PDF Library Expert
Debenu Quick PDF Library Expert


Joined: 29 Oct 05
Location: United States
Status: Offline
Points: 251
Post Options Post Options   Thanks (0) Thanks(0)   Quote chicks Quote  Post ReplyReply Direct Link To This Post Posted: 28 Mar 07 at 2:11PM
Quote leaves an Acrobat window open


Really? Which version of Acrobat/Reader?
Back to Top
skwirelboy View Drop Down
Team Player
Team Player


Joined: 27 Feb 06
Status: Offline
Points: 45
Post Options Post Options   Thanks (0) Thanks(0)   Quote skwirelboy Quote  Post ReplyReply Direct Link To This Post Posted: 29 Mar 07 at 3:46AM
8
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3524
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 29 Mar 07 at 5:03AM
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

Back to Top
chicks View Drop Down
Debenu Quick PDF Library Expert
Debenu Quick PDF Library Expert


Joined: 29 Oct 05
Location: United States
Status: Offline
Points: 251
Post Options Post Options   Thanks (0) Thanks(0)   Quote chicks Quote  Post ReplyReply Direct Link To This Post Posted: 29 Mar 07 at 9:35AM
Originally posted by skwirelboy skwirelboy wrote:

8


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.
Back to Top
skwirelboy View Drop Down
Team Player
Team Player


Joined: 27 Feb 06
Status: Offline
Points: 45
Post Options Post Options   Thanks (0) Thanks(0)   Quote skwirelboy Quote  Post ReplyReply Direct Link To This Post Posted: 29 Mar 07 at 9:40AM
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
Back to Top
chicks View Drop Down
Debenu Quick PDF Library Expert
Debenu Quick PDF Library Expert


Joined: 29 Oct 05
Location: United States
Status: Offline
Points: 251
Post Options Post Options   Thanks (0) Thanks(0)   Quote chicks Quote  Post ReplyReply Direct Link To This Post Posted: 29 Mar 07 at 10:06AM
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
Back to Top
skwirelboy View Drop Down
Team Player
Team Player


Joined: 27 Feb 06
Status: Offline
Points: 45
Post Options Post Options   Thanks (0) Thanks(0)   Quote skwirelboy Quote  Post ReplyReply Direct Link To This Post Posted: 29 Mar 07 at 10:42AM
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
Back to Top
chicks View Drop Down
Debenu Quick PDF Library Expert
Debenu Quick PDF Library Expert


Joined: 29 Oct 05
Location: United States
Status: Offline
Points: 251
Post Options Post Options   Thanks (0) Thanks(0)   Quote chicks Quote  Post ReplyReply Direct Link To This Post Posted: 29 Mar 07 at 10:57AM
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
Back to Top
chicks View Drop Down
Debenu Quick PDF Library Expert
Debenu Quick PDF Library Expert


Joined: 29 Oct 05
Location: United States
Status: Offline
Points: 251
Post Options Post Options   Thanks (0) Thanks(0)   Quote chicks Quote  Post ReplyReply Direct Link To This Post Posted: 29 Mar 07 at 11:48AM
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.
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.01
Copyright ©2001-2014 Web Wiz Ltd.

Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. AboutContactBlogSupportOnline Store