>
> Hi,
>
> I want to read line by line the content stream from a pdf input that has
> been done using Latex, but in my tests I make it with iText (actually I
> won't make the pdf inputs, so I only can obtain information about how it is
> done from the content stream) and remake this pdf in an output pdf. Using
> code from chapter 18 of the book I used PrintStream to write this
> contenstream in a .txt file, and then read it line by line and finally
> create the same pdf with some changes in the leading in a pdf output. My
> code works, more or less, when the fonts in the pdf are Standard Type 1
> fonts.
>
> My code is doing this:
>
> 1. Do a Hashmap with the key font (exemple /F1) and values: name,
> encoding , if it is embedded, and the type, using in DumpFontNames.java
> from Paulo Soares
> 2. I read line by line from the txt
> 3. If the line is about a font (starts with "/") I search in a HashMap I
> did before the key (I used tokenizer to get "/F1" from the line) and so I
> can creat a BaseFont using this information and use showText in the next
> lines that are text (which for exemple ends in "Tj")
>
> If the pdf has a ttf font, for exemple, when I read the content stream it
> is subset, but as the DumpFonts does I put the name of the font in the
> HashMap doing a name.substring(8) (after the +). My question is that if this
> name with the substring could be the name of the ttf file, but anyway,
> although it is I can't know if it is a ttf file because the Type of the font
> would be Type 0.
>
> I thinked in use FontFactory to register all the fonts, and if I understood
> right, I only need the name (without the file type) when I create a Font
> with FontFactory. The problem is I am using ContentByte to create the new
> pdf, and with setFontAndSize I can't use a Font (I must use a BaseFont).
>
> Another problem comes from the .txt file, because using
> PringStream.println() I am printing a byte array using the default encoding
> of the system ( I think it is winansi), so I think I have to use PrintWriter
> and that I could use setContentType in the OutputStream to tell the type,
> but I don't know it in advance... the pdf could have many different fonts
> types and it suppose I don't know which until I could read the
> contenstream.....
>
> I hope my explanation is clear....and sorry if I did foolish remarks...
> If anyone can tell me what he/she thinks about my problem I would be very
> grateful
>
> Thank you very much in advance
>
> Best Regards,
> Laura
>
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Do you like iText?
Buy the iText book: http://www.1t3xt.com/docs/book.php
Or leave a tip: https://tipit.to/itexttipjar

Reply via email to