Hello Paolo Soares,

Hello all

 

Thank you Paolo for your helping hint for reducing redundant font
embedding with BaseFont.getDocumentFonts() and replace the FontFile2. It
works well (font looks same even font is not installed on local
computer) and reduces a lot of needed disk space (factor 10 or more -
depending on number of pages).

 

But we need to reduce more disk space (but the font embedding should be
kept).

To reduce the needed disk space of a PDF document we want to change the
encoding of embedded font from ASCIIHexDecode (not very memory efficient
encoding - 40% overhead) to another, like LZWDecode.

 

I see following two possible ways to solve the problem:

1: Get the stream of the font 'embedding' (I know how to) -> get the
decoded data (I guess with
PdfReader.ASCIIHexDecode(byte-array-of-stream) ) -> encode the data to
more 'efficient' encoding (I don't know how to) -> replace old stream (I
guess I know how)
 
2: Get the stream of the font 'embedding' (I know how to) -> get the
decoded data (I guess with
PdfReader.ASCIIHexDecode(byte-array-of-stream) ) -> create a new font
with decoded data as font embedding and encoding (I don't' know how - I
guess with instance of BaseFont) -> replace the FontFile2 (now I know
how to)...
 
Can somebody help me?
 
Thanks in advance and best regards,
Sascha Fuchs

 

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
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/

Reply via email to