Hi,
It did not work out ,either.  When I press ctrl+a, some of the texts are not 
chosen. This issue remains the same when I use writer.getDirectContent(); 
instead of writer.getDirectContentUnder();. I can see the arabic text but it is 
not selected when I press ctrl+a. 
For the record, I also require and use absolute positioning for the text , I do 
not know whether this may be the problem.
Regards

Date: Mon, 3 Jun 2013 14:13:29 +0300
From: mohammed.alsay...@gmail.com
To: itext-questions@lists.sourceforge.net
Subject: Re: [iText-questions] Itext Arabic ctrl+a hidden text problem

Just  try to use this 


   const string regex_match_arabic_hebrew = @"[\u0600-\u06FF,\u0590-\u05FF]+";

    BaseFont nationalBase = 
BaseFont.CreateFont("c:\\\\windows\\\\fonts\\\\Times.ttf", BaseFont.IDENTITY_H, 
BaseFont.EMBEDDED);
  Font ArabiBold = new Font(nationalBase, 10f, Font.BOLD);
///////////////////////
//////////  and create  a phreas  with your font///////////////////////



 iTextSharp.text.pdf.PdfPCell cell = new iTextSharp.text.pdf.PdfPCell(new 
Phrase("مجموع الوارد", ArabiBold));        cell.RunDirection = 
PdfWriter.RUN_DIRECTION_RTL;
        cell.HorizontalAlignment = 1;        cell.Colspan = 2;        
cell.FixedHeight = 40;        Rtable.AddCell(cell);


On 3 June 2013 14:02, Burak Aydın <baydi...@hotmail.com> wrote:




Hi,
My code to produce arabic hidden text pdf is below.  I add text under an image. 
After producing the pdf, I can not see the text when I press ctrl+a. This only 
happens with arabic characters, not with english ones:

adobe_reader_ctrl_a --> When I press ctrl+a in adobe reader, I can not see the 
text although its location is highlighted.document_viewer_ctrl_a --> When I 
press ctrl+a in ubuntu document viewer, I can only see 2 of the hidden texts
document_viewer_mouse_select--> I press ctrl+a, select one text with mouse, and 
then select all of the page, then I can see whole hidden texts in the pdf. 
What may be the cause?

        ......
        Document document = new Document();

        PdfWriter writer =
PdfWriter.getInstance(document, new FileOutputStream("output.pdf"));

        document.open();

        Image image =
Image.getInstance("/home/burak/IdeaProjects/example.jpg");

        image.setAbsolutePosition(0,
0);

        document.setPageSize(new
Rectangle(image.getWidth(), image.getHeight()));

        document.add(image);


        PdfContentByte contentByte;

        contentByte = writer.getDirectContentUnder();

        contentByte.beginText();

        contentByte.moveText(100, 100);

       
contentByte.setFontAndSize(BaseFont.createFont("data/simpo.ttf",
BaseFont.IDENTITY_H, true), 30);

       
contentByte.showText("100-100-ﻡﻭﺱﻯ ﺍﻭﻍﻝﻯ ﺍﺱﻡﺍﻉﻯﻝ");

        contentByte.endText();



        contentByte.beginText();

        contentByte.moveText(100, 200);

       
contentByte.setFontAndSize(BaseFont.createFont("data/simpo.ttf",
BaseFont.IDENTITY_H, true), 30);

       
contentByte.showText("100-200-ﻡﻭﺱﻯ ﺍﻭﻍﻝﻯ ﺍﺱﻡﺍﻉﻯﻝ");

        contentByte.endText();



        contentByte.beginText();

        contentByte.moveText(100, 300);

       
contentByte.setFontAndSize(BaseFont.createFont("data/simpo.ttf",
BaseFont.IDENTITY_H, true), 30);

        contentByte.showText("100-300-ﻡﻭﺱﻯ
ﺍﻭﻍﻝﻯ ﺍﺱﻡﺍﻉﻯﻝ");

        contentByte.endText();



        contentByte.beginText();

        contentByte.moveText(0, 0);

       
contentByte.setFontAndSize(BaseFont.createFont("data/simpo.ttf",
BaseFont.IDENTITY_H, true), 30);

        contentByte.showText("0-0-ﻡﻭﺱﻯ
ﺍﻭﻍﻝﻯ ﺍﺱﻡﺍﻉﻯﻝ");

        contentByte.endText();



        contentByte.beginText();

        contentByte.moveText(120, 290);

       
contentByte.setFontAndSize(BaseFont.createFont("data/simpo.ttf",
BaseFont.IDENTITY_H, true), 30);

        contentByte.showText("120-290-ﻡﻭﺱﻯ
ﺍﻭﻍﻝﻯ ﺍﺱﻡﺍﻉﻯﻝ");

        contentByte.endText();



        contentByte.beginText();

        contentByte.moveText(120, 310);

       
contentByte.setFontAndSize(BaseFont.createFont("data/simpo.ttf",
BaseFont.IDENTITY_H, true), 30);

       
contentByte.showText("120-300-ﻡﻭﺱﻯ ﺍﻭﻍﻝﻯ ﺍﺱﻡﺍﻉﻯﻝ");

        contentByte.endText();



        document.close();
..

 
Thanks in advance
                                          

------------------------------------------------------------------------------

Get 100% visibility into Java/.NET code with AppDynamics Lite

It's a free troubleshooting tool designed for production

Get down to code-level detail for bottlenecks, with <2% overhead.

Download for free and get started troubleshooting in minutes.

http://p.sf.net/sfu/appdyn_d2d_ap2
_______________________________________________

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



-- 
Best Regards
---------------------------
Mohammed Hashem
Web Developer @ ArabSea.
www.arabsea.com
00966 - 538 766 152




------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite
It's a free troubleshooting tool designed for production
Get down to code-level detail for bottlenecks, with 
_______________________________________________
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                                       
------------------------------------------------------------------------------
How ServiceNow helps IT people transform IT departments:
1. A cloud service to automate IT design, transition and operations
2. Dashboards that offer high-level views of enterprise services
3. A single system of record for all IT processes
http://p.sf.net/sfu/servicenow-d2d-j
_______________________________________________
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