Dear sir,

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

The follwing code adds some text with given amount of charecter spacing

var pdfStamper = new PdfStamper(pdfReader, new FileStream(outPutFname,
FileMode.Create));

            BaseFont customfont = BaseFont.CreateFont(@"E:\MyFont.ttf",
                                                      "winansi",
BaseFont.EMBEDDED);
            AcroFields pdfFormFields = pdfStamper.AcroFields;


            PdfContentByte cb = pdfStamper.GetOverContent(1);

            cb.SetCharacterSpacing(2);//Set amount of space you want
            cb.SetFontAndSize(customfont, 16);
            cb.BeginText();
            cb.ShowText("Test");
            cb.EndText();

            pdfStamper.FormFlattening = false;
            pdfStamper.Close();
            pdfReader.Close();

But I have to set space on existing text in the pdf, while this code will
add new text ("test") in the pdf.

please help me. thanks in advance.

-- 
*Thanks & Regards

Shafi**
Sr. Software engineer** | Propalms Network Pvt Ltd. Pune
*
http://www. 
<http://www.tlcinfotech.co.in/>propalmsnetwork.com<shafiuddin.ham...@propalmsnetwork.com>|
shafiuddin.ham...@propalmsnetwork.com
8600335990
------------------------------------------------------------------------------
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