> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On
> Behalf Of Sascha Fuchs
> Sent: Monday, April 16, 2007 10:09 AM
> To: Post all your questions about iText here
> Subject: [iText-questions] Change encoding of font
>
> 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
You have a PDF producer that doesn't compress fonts? Amazing.
> very memory efficient encoding - 40% overhead) to another,
> like LZWDecode.
>
FlateDecode.
>
>
> 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?
>
You have methods in PdfReader to get the stream content and that already
returns uncompressed. Create a PdfStream with that and replace it in the
apropriate place.
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 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/