Print Page | Close Window

Print PDF - 2

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: I need help - I can help
Forum Description: Problems and solutions while programming with the Debenu Quick PDF Library and Debenu PDF Viewer SDK
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=289
Printed Date: 22 Nov 24 at 7:15PM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: Print PDF - 2
Posted By: phora
Subject: Print PDF - 2
Date Posted: 27 Jan 06 at 5:11AM

Hi.

I need to print a pdf (~ 40K) and I use

QP.PrintDocument( Printer, 1, QP.PageCount, QP.PrintOptions( 1, 1, '' ) );

It takes about 1 minute !!!!!!!

How can i make my process a little more faster ?

Thanks for any suggestions.

phora

 




Replies:
Posted By: JanN
Date Posted: 27 Jan 06 at 6:42AM
Wow, that's quite long. On what machine and OS are you running your application?

I also have experienced problems while printing with QuickPdf. But not with such small files.

How big is the spool job in the end?


Posted By: JanN
Date Posted: 27 Jan 06 at 6:45AM
Perhaps it is an alternative to print the document using Adobe Reader:

http://www.quickpdf.org/forum/forum_posts.asp?TID=139&PN=1


Posted By: phora
Date Posted: 27 Jan 06 at 7:13AM

The SO is Win98SE but I have this problem also on Win2000 or WinXP.

I'm using Delphi V.4

At the end, the spool job is 5.xx Mb ...

I tried to use AcroRd32 with "/p /h", but I' (as suggested by Ingo...) but I'm non very happy that AcroRd32 shows its windows...

My code is:

       QP.SaveToFile( '~~TMP.PDF' );
        if ( FindExecutable( '~~TMP.PDF', nil, ExeFileName ) > 32 ) then
     ShellExecute( hinstance, 'open', ExeFileName, PChar('/p /h ~~TMP.PDF' ), nil, SW_HIDE )
        else
         Res := ( QP.PrintDocument( Stampante, 1, QP.PageCount, QP.PrintOptions( 0, 1, '' ) ) > 0 );
       DeleteFile( '~~TMP.PDF' );

 

 



Posted By: phora
Date Posted: 27 Jan 06 at 8:58AM

PS.

If I use

ShellExecute( hinstance, 'open', ExeFileName, PChar('/p /h ~~TMP.PDF' ), nil, SW_HIDE )

I can print only on then default printer, I'm not able to select another printer...

This is not a very good ... above all for my costumers

 

Andrea



Posted By: chicks
Date Posted: 27 Jan 06 at 10:30AM
It's best to use Adobe Reader's DDE interface for printing. It's documented in Adobe's IACReference.

Here's an example, with full source code, that hides Reader's splash screen; allows wildcard batch printing; printer, orientation and duplex selection; and closes Reader when printing is done:

http://www.geocities.com/sea_sbs/files/pdfp.zip

Here are some other "fun with QuickPDF" examples:

http://www.noliturbare.com/ChicksTools.html



Posted By: swb1
Date Posted: 27 Jan 06 at 10:42AM
I have found (in the case of QuickPDF)  that page count is often a more important factor than is file size. How many pages does this document have?


Posted By: seva
Date Posted: 27 Jan 06 at 12:30PM

Chicks,

Is it possible to set the printer page size with Adobe Reader's DDE interface ?



-------------
Seva Minkovich
www.etecad.com
seva@etecad.com


Posted By: chicks
Date Posted: 27 Jan 06 at 12:45PM
No, the DDE interface is strictly for printing the PDF. All printer settings need to be done first through the Windows API - anything that you set up in Reader from the "File/Print Setup" menu should be settable via the Windows printing API, which is a bit complex.

There is a way to set printer settings via Adobe Javascript, through Adobe's JSObject API, but I don't think it's accessible in Reader, just Acrobat (I may be wrong...)

Here's a linke to Adobe's IACReference document:

http://partners.adobe.com/public/developer/en/acrobat/sdk/pdf/iac/IACReference.pdf

Note that only a few of the DDE messages are available in Reader. The only COM object usable from Reader is
AxAcroPDFLib.AxAcroPDF, which can also be used for printing (and viewing), but it's only availabe in Reader 7.



Posted By: phora
Date Posted: 30 Jan 06 at 8:20AM

Hi Chicks.

Thanks for your help: I'm traslating from C to Delphi your code   so I can try it with my console application.

It your code good also for PC with OS lesser then Win200 and Acrobat Reader less than V.7.0.5 ?

Bye

 



-------------
Regards.
Andrea


Posted By: phora
Date Posted: 30 Jan 06 at 9:22AM

Hi CHicks.

I don't understand why you not use "DocOpen" and "DocClose" DDE messages in your code ....

The correct sequence'd be:

1) DocOpen

2) FilePrintTo

3) DocClose



-------------
Regards.
Andrea


Posted By: chicks
Date Posted: 30 Jan 06 at 11:09AM
Andrea,

Reader's DDE interface goes back at least to version 4. I don't have any OS still running before Win2K, but I don't see any reason why it wouldn't run on '95 or '98.

DocOpen and DocClose are only required if you are planning to view the documents in Reader. FilePrintTo works fine on its own.


Posted By: phora
Date Posted: 30 Jan 06 at 12:15PM

Thanks



-------------
Regards.
Andrea


Posted By: lapinig
Date Posted: 12 Feb 06 at 5:58AM
I had a similar problem, i print 2 or 3 copies on Kyocera FS-1750 Laser Printer with command QP.PrintDocument and using QP.PrintOptions and the Kyocera print one copy in one minute and another one minute for the next copy !!! Without using QP.PrintOptions the printer is much faster. I change the printer driver choosing a PCL driver instead the fully options Kyocera driver. Now i obtain the 2 copies in 20 seconds!!!


Posted By: phora
Date Posted: 13 Feb 06 at 3:23AM

Hi lapinig (Ciao)

Can you post an example of your code (2/3 righe di codice) ?

How can you work without QP.PrintOptions ?

Thanks (grasssssie)

 



-------------
Regards.
Andrea


Posted By: lapinig
Date Posted: 19 Feb 06 at 6:02AM
Hi Phora

i used this fragment of code to print many copies of the same pdf document

' Default stampa tutte le pagine
PrimaPagina = 1
UltimaPagina = oPdf.PageCount()
' in txtCopie.text è indicato il numero di copie
' in <PrnName> è indicato il nome Windows della stampante
PrnName = "Epson EPL-6200L"
for j=1 to val(txtCopie.text)
oPdf.PrintDocument PrnName, PrimaPagina, UltimaPagina, 0
next j

With this command the speed of printing is very slow (i work with a Kyocera FS-1750), but using the NewCustomPrinter and PrintOptions the speed has incremented by 4-10 times!!!

Mi puoi contattare a questa e-mail lapinig(chiocciola)tiscali(punto)it
ciao
gualtiero


Posted By: lapinig
Date Posted: 19 Feb 06 at 6:13AM
I used a freeware open source PDFP.EXE to print, but for example it print "only" files with PDF extension, while i hide the file type used in my programs, i name the pdf file like *.$$$ (like a temporary file). PDFP has some problem printing on net shared printer and appear the dos window and i never want it.
Using Acrobat Reader to print directly the file generates many problems, like program hanging if there is a internet connection (attempting to update AcroReader, etc.) and my program depend on the version of acrobat reader installed...
Using Ised library i had resolve ALL my problems...


Posted By: chicks
Date Posted: 19 Feb 06 at 2:17PM
Originally posted by lapinig lapinig wrote:

I used a freeware open source PDFP.EXE to print, but for example it print "only" files with PDF extension, while i hide the file type used in my programs, i name the pdf file like *.$$$ (like a temporary file).


Which is one reason I made it open source, so you can change it to meet your needs...

Originally posted by lapinig lapinig wrote:


PDFP has some problem printing on net shared printer


News to me...

Originally posted by lapinig lapinig wrote:


and appear the dos window and i never want it.


See above comment re open source...

Originally posted by lapinig lapinig wrote:


Using Acrobat Reader to print directly the file generates many problems, like program hanging if there is a internet connection (attempting to update AcroReader, etc.) and my program depend on the version of acrobat reader installed...


Updates happen what, twice a year... Not exactly a major issue... I used the DDE interface rather than the new COM interface exactly for this reason - there ARE NO Reader version issues with the DDE interface...

Originally posted by lapinig lapinig wrote:


Using Ised library i had resolve ALL my problems...


Except spool file size, performance, rendering quality, inability to render MANY images correctly...

Don't get me wrong, I am a HUGE fan if QuickPDF as a general purpose PDF library, and use it in many applications. Its rendering/printing capabilities, on the other hand, are not up to the quality of the rest of the library, and certainly don't come close to Adobe Reader.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.01 - http://www.webwizforums.com
Copyright ©2001-2014 Web Wiz Ltd. - http://www.webwiz.co.uk