Shafi hameed,

Shafi hameed wrote
> 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)

Why didn't you say so from the start?

> 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.

That reminds me of an answer on stack overflow,  Changing font of PDF using
iTextSharp <http://stackoverflow.com/a/15241639/1729265>  ... As that
solution worked "as per [the asker's] expectation," I didn't look into it.
That person actually merely replaced the base font name leaving everything
else untouched. Thinking about that solution makes clear that it involves
many preconditions to work acceptably.

> 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.

If you did the same trick and now run into this kind of problems, you most
likely have not adjusted the character widths array. Therefore, the PDF
viewer thinks it should display the Braille characters using the widths of
the corresponding Arial characters.

PDF objects representing Arial in a PDF look like this:

9 0 obj
<<
/Type /Font/Subtype /TrueType/Name /F0/BaseFont /Arial /Encoding
/WinAnsiEncoding/FirstChar 32/LastChar 255/Widths [278 278 355 556 556 889
667 190 333 333 389 584 278 333 278 278 556 556 556 556 556 556 556 556 556
556 278 278 584 584 584 556 1015 667 667 722 722 667 610 778 722 278 500 667
556 832 722 778 667 778 722 667 610 722 667 944 667 667 610 278 278 278 469
556 333 556 556 500 556 556 278 556 556 222 222 500 222 832 556 556 556 556
333 500 278 556 500 722 500 500 500 334 260 334 584 750 556 750 222 556 333
1000 556 556 333 1000 667 333 1000 750 610 750 750 222 222 333 333 350 556
1000 333 1000 500 333 944 750 500 667 278 333 556 556 556 556 260 556 333
736 370 556 584 333 736 552 400 549 333 333 333 576 537 278 333 333 365 556
834 834 834 610 667 667 667 667 667 667 1000 722 667 667 667 667 278 278 278
278 722 722 778 778 778 778 778 584 778 722 722 722 722 667 667 610 556 556
556 556 556 556 889 500 556 556 556 556 278 278 278 278 556 556 556 556 556
556 556 549 610 556 556 556 556 500 556 500]/FontDescriptor 13 0 R
>>
endobj
13 0 obj
<<
/Type /FontDescriptor/FontName /Arial /Flags 32/FontBBox[-250 -144 2664
864]/Ascent 864/Descent -144/CapHeight 864/AvgWidth 432/MaxWidth
2664/MissingWidth 2664/StemH 78/StemV 78/ItalicAngle 0
>>
endobj

When changing this to Braille, it generally does not suffice to replace the
name. Instead the other pieces of information you see here also should be
adjusted. In your case the effects of the /Widths array are most appearant
but the other entries visible here should be inspected, too.

> 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.
> OR
> please tell me any easer way to change the all text fonts into Braille or
> any selected font.

I would propose you first try to replace the other relevant font information
(first your widths array), too, not only the base font name. Then start
dealing with text that went beyond the margins and other visual artifacts.

Regards,   Michael



--
View this message in context: 
http://itext-general.2136553.n4.nabble.com/Re-Need-help-for-Character-Spacing-in-existing-pdf-tp4657800p4657806.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:
http://p.sf.net/sfu/appdyn_d2d_mar
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

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

Reply via email to