> -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On > Behalf Of Stéphan DROC (COFRAMI) > Sent: Thursday, March 06, 2008 5:17 PM > To: [email protected] > Subject: [iText-questions] Resources in PDF document > > Hello > > I generate a pdf with FOP tool and I have lot of graphics > (3600 XObject > ~130Mo) in 1 Resource.
FOP uses the same resource dictionary for all the pages? That must be a really old FOP version, I hope. > When I extract a page, I have the page stream with content > and this resource > > Conclusion > I generate a PDF with 1 page with size is equal to 140 Mo. > > Can remove Xobject were not used by one or more pages in the PDF. It's not that difficult. Parse the content stream with PdfContentParser and build a list of all the xobjects (the ones with the 'do' command). Compare this list with the resource and eliminate xobjects not needed. Call PdfReader.removeUnusedObjects() to clean the pdf and use PdfStamper to output the result. Paulo Aviso Legal: Esta mensagem é destinada exclusivamente ao destinatário. Pode conter informação confidencial ou legalmente protegida. A incorrecta transmissão desta mensagem não significa a perca de confidencialidade. Se esta mensagem for recebida por engano, por favor envie-a de volta para o remetente e apague-a do seu sistema de imediato. É proibido a qualquer pessoa que não o destinatário de usar, revelar ou distribuir qualquer parte desta mensagem. Disclaimer: This message is destined exclusively to the intended receiver. It may contain confidential or legally protected information. The incorrect transmission of this message does not mean the loss of its confidentiality. If this message is received by mistake, please send it back to the sender and delete it from your system immediately. It is forbidden to any person who is not the intended receiver to use, distribute or copy any part of this message. ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ iText-questions mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://itext.ugent.be/itext-in-action/
