The printer is an HP Laserjet 3300 and each image size is between 100 and 250 kb, most of them with the dimension of the A4 format (some of them has the A3 format size). I print the documents with Acrobat Reader and not by java code.
I don't know if it is a problem, but if I try to print any image of them with a picture viewer software it take much less time.
----- Original Message -----
Sent: Tuesday, November 09, 2004 1:06 PM
Subject: RE: [iText-questions] slow printing of pdf document with jpg images

Is it a problem? What kind of printer do you have? What's the image size?
 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of dott. Giacomo Galletto
Sent: Tuesday, November 09, 2004 12:02 PM
To: [EMAIL PROTECTED]
Subject: [iText-questions] slow printing of pdf document with jpg images

Hi,
 
I search through the mailing-list threads to search about a problem similar to mine but I didn't find anything.
I'm generating PDF documents simply adding a JPEG image for each page. The document is created in a very fast way and it is perfectly readable with Acrobat Reader 5 or 6. The problem is when I try to print the document: the printing process is very slow: about a page per minute.
Any of you had experience about this problem?
Your help would be very appreciate.
Thanks a lot.
 
 
The code I use to create PDF document is:
 
com.lowagie.text.Document document = null;
PdfWriter pdfWriter = null;
 
try {
     document = new com.lowagie.text.Document();
     pdfWriter = PdfWriter.getInstance(document, new FileOutputStream(path + "document.pdf"));            
     document.open();
}
catch(Exception ex) { // Exception handling here... }
 
if (document != null && pdfWriter != null) {
                    
     boolean open = false;
                        
     for (int t = 0; t < images.size(); t++) { // images is a Vector of byte[], each for every JPEG image to include in the document
       
        com.lowagie.text.Image immagine = com.lowagie.text.Image.getInstance((byte[])images.elementAt(t));
        immagine.scaleToFit(formato.width() - 30, formato.height() - 30);
                                
        if (!open) {
           document.open();
           open = true;
        }
                                
        immagine.setAbsolutePosition(3, 0);
        document.newPage();
        document.add(immagine);
     }
document.close();
 

Reply via email to