Changing the font of any arbitrary text in any arbitrary PDF is EXTREMELY DIFFICULT (or may even be impossible in some cases). You really need to read ISO 32000-1:2008 (the PDF standard) to get a deep understanding of font technology and text encoding issues and why it is such a hard problem.
Changing the character spacing of a run of text is easy there is a text state operator (Tc) for that.
From: Shafi hameed <***@gmail.com<mailto:***@gmail.com>>
Reply-To: Post here <email@example.com<mailto:firstname.lastname@example.org>>
Date: Wednesday, March 13, 2013 11:34 AM
To: Post here <email@example.com<mailto:firstname.lastname@example.org>>
Subject: Re: [iText-questions] [SPAM] Re: Need help for Character Spacing in existing pdf
Actually my basic requirement is to change the font of existing pdf into 'Braille' (Braille.ttf is a true type font basically for blind people)
I want to select any PDF file and want to change all its font into Braille. as I did not findno easy method to change the existing text font, I did some trick to change all the text's font into Braille.
every thing worked fine for me but another problem occurred, since The width of Braille font is greater than the actual font's width which resulted the overlapping of character. file fully converted into Braille font but there is very less distance between two character. so I thought if I could set a spacing between two character, my problem would be solved.
please tell me any easer way to change the all text fonts into Braille or any selected font.
On Wed, Mar 13, 2013 at 3:39 PM, mkl <***@wir-sind-cool.org<mailto:***@wir-sind-cool.org>> wrote:
I have a pdf file in which all the contents are in Arial font. my
requirement is to set a space between every character. eg. i want to
change 'HELLO' as 'H E L L O'.
Unless you only need to do that for the single PDF you mentioned (or a some
PDFs internally very similar), that is a hell of an assignment. And as your
title in your footer says that you are a "Sr. Software engineer", I'm
inclined to doubt that this is only an excercise with only one target PDF...
Some questions, therefore:
1. Do you really only need to process that one PDF you mentioned? Or only
PDFs internally very similar? In these cases, please provide that PDF.
2. Can the text content of the PDFs in question be considered parsable?
3. How wide should that space be? The width of a regular space character?
Some custom width? A width to calculate from font size and style?
4. Inserting a space makes text lines longer. Does your assignment include
reflowing lines which afterwards would reach beyond some margin? In that
case, are the margins and the general page structure known?
5. When copying and pasting text from your PDF, shall that text also
include the spaces?
6. Does your assignment involve shifting annotations and jump targets which
might be considered anchored relative to certain page content?
Depending on the answers there may follow more questions still.
View this message in context: http://itext-general.2136553.n4.nabble.com/Re-Need-help-for-Character-Spacing-in-existing-pdf-tp4657800p4657801.html
Sent from the iText - General mailing list archive at Nabble.com.
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
iText-questions mailing list
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
Thanks & Regards
Sr. Software engineer | Propalms Network Pvt Ltd. Pune
http://www.<http://www.tlcinfotech.co.in/>propalmsnetwork.com<mailto:***@propalmsnetwork.com> | ***@propalmsnetwork.com<mailto:***@propalmsnetwork.com>