Welcome to the 21st century.  You /really/ need to get a more recent version of 
iText.  The bug you've encountered in 1.3 has certainly been fixed long ago.

The current version is 5.0.6.  Note that the packages AND LICENSE have changed. 
 Everything is now in "com.itextpdf.*", and licensed under the AGPL.  The AGPL 
requires that anyone with access to the output of the program likewise have 
access to the source.  With iText, that means that anyone who can download a 
PDF should be able to download the source.

There's also commercial licensing available through itextsoftware.com.  

PS: the last version to use the MPL/LGPL was 2.1.7, which you can still find if 
you look hard enough.

PPS: Acrobat Pro (you can download a timed free trial if need be) can run a 
Space Audit on your file to see what's taking up all your space.  Knowing that 
can save you quite a bit of effort.  Premature optimizations and all that.

--Mark Storer
  Senior Software Engineer
  Cardiff.com
 
import legalese.Disclaimer;
Disclaimer<Cardiff> DisCard = null;
 
 

> -----Original Message-----
> From: Mathieu [mailto:[email protected]] 
> Sent: Tuesday, March 15, 2011 7:09 AM
> To: [email protected]
> Subject: [iText-questions] How to reduce size of PDF with 
> form fields ?
> 
> Hi,
> i'm willing to reduce the size of my PDF (generated with 
> iText-1.3 on Java).
> I'm using existing PDF template file with internal fields 
> (form). I fill them using AcroFields, with a PdfStamper.
> My final PDF weighs about 350Ko.
> 
> I tryied the following code to compress the file size :
> 
> final PdfStamper stamper = new PdfStamper(reader, baos, 
> PdfWriter.VERSION_1_5, false); [...] 
> stamper.setFormFlattening(true); 
> stamper.setFullCompression(); stamper.close();
> 
> But i only gain about 10Ko less on my final file.
> 
> Then i tested these lines to remove unused objects from my PDF file :
> 
> stamper.getReader().removeAnnotations();
> stamper.getReader().removeFields();
> stamper.getReader().removeUnusedObjects();
> 
> Here, i managed to reduce the file size by 200Ko (file size: 
> 130Ko - Great!). But the down side is that my file isn't well 
> formed anymore. I've got an error from my PDF viewer when 
> opening the file (Acrobat reader says "This file contains an 
> error..."), and the text shown in the PDF contains bad 
> encoded characters (the text is in French and contains some 
> accents ('È ' instead of 'é', '‡' instead of 'à').
> 
> My question is: Is there any way to reduce the size of a PDF 
> file without corrupting it ?
> Any help would be appreciated. I really need to decrease the 
> size of these generated PDF files. I tryied to print my PDF 
> into another PDF using PDFCreator (just for test) and the 
> size decreased from 350Ko to 244Ko without any loss in the 
> PDF file. So i think there have to be a way to do so with 
> iText, isn't it?
> 
> Thanks!
> 
> --
> View this message in context: 
> http://itext-general.2136553.n4.nabble.com/How-to-reduce-size-
> of-PDF-with-form-fields-tp3356683p3356683.html
> Sent from the iText - General mailing list archive at Nabble.com.
> 
> --------------------------------------------------------------
> ----------------
> Colocation vs. Managed Hosting
> A question and answer guide to determining the best fit for 
> your organization - today and in the future.
> http://p.sf.net/sfu/internap-sfd2d
> _______________________________________________
> iText-questions mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/itext-questions
> 
> iText(R) is a registered trademark of 1T3XT BVBA.
> Many questions posted to this list can (and will) be answered 
> with a reference to the iText book: 
> http://www.itextpdf.com/book/ Please check the keywords list 
> before you ask for examples: http://itextpdf.com/themes/keywords.php
> 

------------------------------------------------------------------------------
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference 
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: 
http://itextpdf.com/themes/keywords.php

Reply via email to