Fix Arabic characters copy on a PDF made using InDesign CS

Hi there,
I'm trying to copy some text from a PDF that wast created using InDesign CS. The text is on Arabic, I can read it correctly but when I copy it, it transforms to strange characters. What is confusing is, the latin text can copy correctly!
You can view an extracted page from this PDF here: https://db.tt/XpLvmJE0
Is the error related to the font? or to the old InDesign CS (codenamed Dragontail: October 2003)
Thanks for your help.

Resolved!
I got it working with some help from PHP
utf8ToUnicodeCodePoints (I use preg_replace_callback both with ord and json_encode)
remapCodePoints to original code point
then reverse the string to match arabic's rtl
The code:
$str = '»°ù«îÑJ';
echo utf8_strrev( utf8ToUnicodeCodePoints($str) ); // echoes; تبخيسـي
function utf8ToUnicodeCodePoints($str) {
    if (!mb_check_encoding($str, 'UTF-8')) {
        trigger_error('$str is not encoded in UTF-8, I cannot work like this');
        return false;
    return preg_replace_callback('/./u', function ($m) {
        $ord = ord($m[0]);
                    $decoded = '';
                    //if it were ASCII it would only ever return integers up to 127
        if ($ord <= 127) {
            $decoded = remapCodePoints( sprintf('\u%04x', $ord) );
                    // values higher than 127 in a UTF-8 string represent the beginning of a multi-byte character
                    else {
           $json = trim(json_encode($m[0]), '"');
           $decoded = remapCodePoints($json);
                    // Returns something like \u00bb
                    return $decoded;
    }, $str);
// Match code points to new ones
function remapCodePoints($str)
          Total glyfs in AXtSAlwaBold; 108.
$unicode_table = array( '\u03bc'=>'ك','\u03a0'=>'ل',
'\u0020'=>' ', '\u0028'=>')', '\u0029'=>'(', '\u002c'=>'،',
'\u0041'=>'ء', '\u0042'=>'~', '\u0043'=>'', '\u0044'=>'', '\u0045'=>'', '\u0046'=>'ئ', '\u0047'=>'ا', '\u0048'=>'ب', '\u0049'=>'ة', '\u004a'=>'ت',
'\u004b'=>'ث', '\u004c'=>'ج', '\u004d'=>'ح', '\u004e'=>'خ', '\u004f'=>'د',
'\u0051'=>'ر', '\u0052'=>'ز', '\u0053'=>'س', '\u0054'=>'ش', '\u0055'=>'ص', '\u0056'=>'ض', '\u0057'=>'ط', '\u0058'=>'ظ', '\u0059'=>'ع', '\u005a'=>'غ',
'\u0061'=>'ف', '\u0062'=>'ق', '\u0063'=>'ك', '\u0064'=>'ل', '\u0065'=>'م', '\u0066'=>'ن', '\u0067'=>'ه', '\u0068'=>'و', '\u0069'=>'ى', '\u006a'=>'ي',
'\u006e'=>'َ', '\u006f'=>'ُ',
'\u0071'=>'ّ', '\u0072'=>'ْ', '\u0073'=>'َّ', '\u0074'=>'ُّ', '\u0075'=>'ِّ',
'\u00c4'=>'ئ', '\u00c9'=>'ا', '\u00d1'=>'ب', '\u00d6'=>'ب', '\u00dc'=>'ب', '\u00e1'=>'ة', '\u00e0'=>'ت', '\u00e2'=>'ت', '\u00e4'=>'ت', '\u00e3'=>'ث',
'\u00e5'=>'ث', '\u00e7'=>'ث', '\u00e9'=>'ج',
'\u00eb'=>'ح', '\u00ed'=>'ح', '\u00ee'=>'خ', '\u00ef'=>'خ', '\u00f3'=>'د', '\u00f2'=>'ذ', '\u00f4'=>'ر', '\u00f5'=>'ز', '\u00f9'=>'س', '\u00fb'=>'ش',
'\u00fc'=>'ص',
'\u2020'=>'ض', '\u00b0'=>'', '\u00a2'=>'', '\u00a3'=>'ط', '\u00a7'=>'ط', '\u2022'=>'ط', '\u00b6'=>'ظ', '\u00a9'=>'ع', '\u2122'=>'ع', '\u00b4'=>'ع',
'\u00a8'=>'غ', '\u00d8'=>'ف',
'\u221e'=>'ف', '\u00b1'=>'ف', '\u2264'=>'ق', '\u2265'=>'ق', '\u00a5'=>'ق', '\u00b5'=>'ك', '\u2202'=>'ك', '\u2211'=>'ك', '\u220f'=>'ل', '\u03c0'=>'ل',
'\u222b'=>'ل', '\u00aa'=>'م', '\u00ba'=>'م', '\u2126'=>'م', '\u00e6'=>'ن', '\u00f8'=>'ن',
'\u00bf'=>'ن', '\u00a1'=>'ه', '\u00ac'=>'ه', '\u0192'=>'و', '\u2248'=>'ى', '\u00ab'=>'ي', '\u00bb'=>'ي', '\u2026'=>'ي',
'\u2019'=>'لا',
'\u00d3 '=>'لا'
          return $unicode_table[ $str ];
// reverse the direction
function utf8_strrev($str){
    preg_match_all('/./us', $str, $ar);
    return join('',array_reverse($ar[0]));

Similar Messages

  • Does anyone know how to change the copy on a pdf made in Indesign?  I don't have that software on my Mac

    Does anyone know how to change the text on a pdf made in Indesign when my Mac doesn't have that software?   Thanks,

    If you don't have access to Acrobat Pro or Nitro PDF Pro,  see this article:
    http://www.labnol.org/software/edit-pdf-files/10870/

  • Arabic characters appear as empty squares when using certain HTML tags or font styles

    Only when HW acceleration is on. Arabic characters appear as empty squares when using "italic" or "oblique" font styles or when using &lt;i&gt; or &lt;em&gt; html tags.
    Try this code to replicate the problem
    <pre>
    &lt;p&gt;مشكلة ظهور المربعات الخالية بدل الحروف&lt;/p&gt;
    &lt;p style="font-style: italic;">Italic مشكلة ظهور المربعات الخالية بدل الحروف&lt;/p&gt;
    &lt;p style="font-style: oblique;">Oblique مشكلة ظهور المربعات الخالية بدل الحروف&lt;/p&gt;
    &lt;i&gt;i tag مشكلة ظهور المربعات الخالية بدل الحروف</i> &lt;br&gt; &lt;br&gt;
    &lt;em&gt;em tag مشكلة ظهور المربعات الخالية بدل الحروف &lt;/em&gt;
    </pre>

    After lots of research, I found the problem. The boxes (squares) show up whenever there is a font in the webpage that does not have Arabic within its Unicode range such as Times New Roman Italic or Oblique. Normally, Firefox will pick another font to display the characters but now, a newly introduced feature is interfering.
    To fix the problem without turning off hardware acceleration.
    Go to about:config
    locate: gfx.font_rendering.directwrite.use_gdi_table_loading
    which is True by default in FF4.0 Beta 10, and change it to False.
    This is a bug that has to be fixed.

  • How do I make a textbox appear in a PDF made in InDesign CC when the cursor rolls over another textbox?

    I'm trying to make a textbox appear in a PDF made in InDesign when the user rolls the cursor over another textbox, and I want it to disappear when the cursor moves off the first textbox. I've tried the following with various setting, and it's just not working for me.
    Display a different button on rollover
    You can create a hot spot in which clicking or mousing over an object displays another object. To do this, create two buttons, hide one of the buttons, and use the Show/Hide Button action to show and hide the target button.
    Create an object to be used as the source button. In the Buttons panel, click the Convert Object To A Button icon.  
    Place the image you want to be used as the target button, and convert it to a button.  
    Select the target image and select Hidden Until Triggered at the bottom of the Buttons panel.  
    The image needs to be hidden in the exported document so that it can be displayed when the source button is moused over or clicked.  
    Select the source button and create two different actions, one to show the target image and a second to hide the target image.  
    If you want the image to appear when the mouse hovers over the source button, use the On Roll Over and On Roll Off events. If you want the image to appear when you click the source button and disappear when you release it, use the On Click and On Release events. In either case, use the Show/Hide Buttons action to display and hide the target button. See Make buttons interactive.   
    Use the Preview panel to test the buttons.  

    Here's more information about what I'm doing.
    1. create text box with a little text
    2. turn it into a button (Button 1)
    3. create another text box with some text
    4. turn this into a button (Button 2)
    5. check "Hidden Until Triggered" for Button 2
    6. For Button 1, select "On Roll Over" for Event
    7. For Button 1, click + to add Action and choose "Show/Hide Buttons and Forms"
    8. For Button 1, change icon next to Button 2 into eyeball (which I assume makes Button 2 visible on roll over).
    9. For Button 1,, select "On Roll Off" for Event
    7. For Button 1, click + to add Action and choose "Show/Hide Buttons and Forms"
    8. For Button 1, change icon next to Button 2 into crossed-out eyeball (which I assume makes Button 2 invisible on roll off).
    8. Export to PDF with modified smallest file size and include bookmarks and hyperlinks and include appearance for interactive elements.
    Both buttons are visible in the PDF, and nothing happens with roll over and off.
    What am I doing wrong?

  • Combine PDF-files using Indesign?

    Hi,
    Is it possible to combine, lets say 15, PDF-files using Indesign and some scripting magic?
    I know it's easily done in Acrobat Pro, but I'd like to skip that step and make it even easier for my colleagues.
    Any hints, tips or links are much appreciated.
    Thanks,
    Thomas

    All you have to do in Acrobat is drag one file after another onto the same window, correct? Then save?
    You can combine PDF files with InDesign, but then you'd get an InDesign file, so you have to export as a new PDF again. Sure, a script can do that for you, but it still sounds like it would take more time, and *definitely* not as easy as the straightforward drag-drop-save steps in Acrobat Pro.

  • How can I make hyperlinks work in InCopy when I export to PDF without using InDesign?

    I created an InCopy document with hyperlinks linking to other InCopy documents. When I exported to PDF, these hyperlinks don't work. Is there any way I can make these hyperlinks work without using InDesign? Thanks.

    beer and no prepress schrieb:
    If it's for the web, why not export to JPEG?  Why PDF?
    Terrible idea. In a JPG the text will not be alive, you loose all interactivity.
    And making JPGs with InDesign is not what the program is meant to make.

  • Items missing on PDF when using Indesign CS5.5 doc in Indesign CS6

    I have had the problem of picking up a document that had been created in Indesign CS5.5 processing to PDF out of Indesign CS6 and two lines of type and two lines of outlined type had 'disappeared' when run to a PDF.
    I spent some time investigating layers etc to no avail. When I eventually processed the document out of CS5.5 to PDF the result was exactly as appearing on screen in Indesign.
    Does anyone know of this discrepancy between 5.5 and 6 or am I doing something wrong?

    Is it interactive PDF or the Print PDF ?
    Are you using the same settings in Cs6 that is in Cs5 ?
    also, are these items on the master page ?

  • Few questions about live cycle 9.0 es2. Opened pdf made from indesign.

    I am new to live cycle. I took a pdf which I created in InDesign.  I have some questions so I may finish editing it in LiveCycle. When I go to group text by dragging the mouse using the field tool, some remains in text boxes, other text remains in light outlined boxes. I would like it to all group and stay within one box for editing. Also, I see no white space to move the text to to edit it off to the right of the form like in InDesign. Nor can I find a way to create a blank page to move the text to to do more editing if  I would like. I also did not see a duplicate spread option to create a copy of the page I am editing. There is blurry and clear text after I opened the pdf in Live Cycle. How do  I make it all clear? This includes an eps logo at the top of the page. How do I do  copy and paste in place. Can I insert a pdf page after I am done edit this pdf page in LiveCycle? CAn brcodes take on alphanumeric, not just 1's and 0's? Thanks.

    No one?
    Some questions are answered by someone else.
    -The SLD is okay, it doesn't need to be configured
    -The Adobe Lifecycle Designer is automatically installed when installing the Netweaver Studio Sneak Preview SP16
    Just two more questions:
    1)when I open http://server:port/webdynpro/dispatcher/local/TutWD_OnlineInteractiveForm/OnlineInteractiveFormApp
    The PDF is shown but I can't use the buttons or the dropdown boxes.
    I tried to install ACF but I have NW04s SP16, and the ACF is only SP11.
    So when I install that, it only shows a blue screen with "I am the placeholder control"
    When I install ACF SP19 for NW04, the PDF shows again, but I still can't use the buttons or dropdowns. Is this normal?
    2) Do I need the license described below?
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes/sdn_oss_bc_srv/~form/handler%7b5f4150503d3030323030363832353030303030303031393732265f4556454e543d444953504c4159265f4e4e554d3d373530373834%7d
    Main questions----
    I need to create a form with a few fields (of which some fields are mandatory); then I have to use a few BAPI's to check these fields and to save the content in a CRM system.
    I've installed Netweaver Sneak Preview, and configured Adobe Document Services (made ADSUser & ADSCaller, set IIOP etc to Autostart, Installed the credentials). The tests seem to work fine, but I haven't developed anything yet.
    My questions:
    1) What about the ACF?
    2) Also the license described above?
    Grz
    Allan

  • Copying text from PDF created using print to PDF function in OS X

    I use a MacBook Pro with Mac OS X Lion, and Microsoft Word 2008 for Mac and Adobe Acrobat Pro.
    For some reason when I use the Print to PDF function to export a PDF of a Word document, then open it with Acrobat Reader or Acrobat Pro 9 and try to select text and copy it then paste it into a word processor (include Word 2008) the resulting text is gibberish. It looks like some sort of encoding issue, but I can't understand that, since it's all happening on the same Mac! I have also tried to do this with Preview as the PDF reader but I still get gibberish.
    The issue first started occuring with Snow Leopard, and all software is patched, but no dice.
    I've attempted to work around this by using all of the different PDF options under the print dialog, and by saving the doc as a PDF, but I still get the same thing.
    I've also tried copying and pasting the text int Pages, then saving it as PDF and trying to ready it .. again, no luck.  I was able to output the file directly from Pages to Preview and save it from there, but it really doesn't seem like this should be necessary, given that the functionality is build into the OS.
    Anybody else have experience with this? I have just one user that needs to copy and paste text from the doc, so it's a real pain to have to maintain separate PDF and Word versions.
    Thanks!
    D

    Rishi,
    Welcome to Apple Discussions.
    After reading your post, I tried to duplicate this problem. I opened a PDF, selected a sentence, then copied it to the clipboard. I then opened Pages, selected the blank template, then pasted in the text. It pasted perfectly.
    Does this problem happen with all text in a PDF? With different PDFs?
    -Dennis

  • Photoshop 7.0.1 will not open .pdf made using Acrobat 9 Pro

    Hi:<br /><br />Acrobat 9 Pro can read a .dwg file made by Autocad and turn it into a .pdf.  There are three choices for the pdf standard: none, PDF/A-1b:2005 or PDF/E-1.  I tried all three and in all cases Photoshop 7 complains with:<br /><br />Could not open <file> because it is not the right kind of document.<br /><br />Is there some trick to getting this to work?<br /><br />Have Fun,<br /><br />Brooke Clarke

    Hi Chris:
    ------SOLVED-----
    Sorry, it's my (human) memory. Need to use the Export method of saving the Acrobat as an image.
    Have Fun,
    Brooke Clarke

  • How do I convert a PDF (made in Indesign) back into an editable InDesign format?

    My hope is to edit just one line, and then we can send to print.Thanks for your help!

    You don’t unless you want spend quite a bit of money for a third party plug in that will like require quite a bit of formatting.
    Where’s the original InDesign file?

  • Video is not loading in Interactive PDF created using Indesign 6.0

    Hi All,
    I am adding the mp4 video within the Indesign 6.0 and when I convert the same into the interactive PDF format but video are not loading at all in iPad. I have added the custom HTML tag as object but still its negative results.
    Please help me out if you have any suggetions on how we can have the video running in interactive PDF on iOS.
    All your help is very much appriciated.
    Thanks & Regards,
    Sumanth C N

    Not all readers on an iPad can show video! In fact Adobe Reader cannot! You must third-party apps. The best is PDF Expert from Readdle (US $10).
    This article explains this issue:
    For Interactive PDF, Not All Readers Are Equal | InDesignSecrets

  • Interactive PDF file using InDesign CS5

    I've created an interactive portfolio within InDesign. Within the InDesign layout I've created a button "Testimonial" when the user clicks it reveals a reference letter. (The reference letter is also a button.) Then the viewer needs to click on a "close" button on the reference letter to go back to the portfolio view.
    It's set up and when I view it within InDesign using the Preview area. It works.
    When I export as a Interactive PDF and view in Acrobat. The "close" button is not there. So I'm unable to return to the portfolio view.
    Any suggestions?

    Thank you... what was wrong. Didn't I do everything correct and have the close button on top in the stacking order... was this a software bug?
    I'm not sure what that other poster was doing. Duplexing won't exist until the drivers get 64 bit clean. I've been there and done that.
    Dwayne

  • ColdFusion 8 drops Arabic characters when generating PDF doc

    Hello All,
    Please let me know what I'm doing wrong here! I have trouble with generating a PDF document from ColdFusion.
    The cfm document contains mixed English and Arabic text and it seems that the ColdFusion's embedded PDF Generator drops Arabic characters when creating the PDF file.
    I attached a bare bone cfm document (see print_test.cfm) that I used as an example to the stated problem.
    The document:
    displays fine in FireFox 3.0.10 (see attached print_test_screenshot.jpg) Used link:
    http://localhost:8500/Print_test.cfm?display=yes
    This image file also shows the characters that get dropped by the ColdFusion's embedded PDF Generator.
    is converted fine in PDF by the FireFox 3.0.10 using print command line (see attached print_test_firefox.pdf) Used command:
    “C:\Program  Files\Mozilla Firefox\firefox.exe" -print "http://localhost:8500/Print_test.cfm?display=yes"  -printmode pdf -printfile "c:\pdf\print_test_firefox.pdf" -printdelay  150
    is NOT converted to PDF properly by the ColdFusion using the embedded PDF generator (see attached print_test_cf.pdf) Used command:  http://localhost:8500/Print_test.cfm
    The print_test.cfm file, which I had to remove since this forum allows me to post only 3 attachments, has the following content:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <cfsavecontent variable="MyPage">
    <head>
    <title>PRINT TEST</title>
    </head>
    <body>
    <table width="810" border="0">
      <tr>
        <td width="225" ><div align="center"><strong>ARABIC TEXT PRINT TEST</strong></div></td>
        <td width="225" ><div align="center"><strong><span dir="rtl">نظام بصمة الوجه في دولة</span></strong></div></td>
      </tr>
    </table>
    </body>
    </html>
    </cfsavecontent>
    <cfif not(isdefined("url.DISPLAY"))>
            <cfdocument format="pdf" filename="c:\pdf\print_test_cf.pdf"  overwrite="yes">
            <cfoutput>#mypage#</cfoutput>
            </cfdocument>
        <cfelse>
        <cfoutput>#mypage#</cfoutput>
    </cfif>
    Thank you all for your help,
    Adrian

    "I suppose you did it through the cfdocument tag in a cfm document". nope i used
      the iText library (the one that ships w/cf) directly in cf to see where the
    problem actually was. i don't think this is something you want to do?
    i reported this as a bug to adobe, you can help get something done by adding
    your own bug report here:
    https://www.adobe.com/cfusion/mmform/index.cfm?name=wishform&product=12&6213=6
    ================ the cf file i used ================
    // file
    thisPDFFile="c:\Inetpub\wwwroot\iText\arabicLigatureTest.PDF";
    // get objects
    pdfFile = createObject("java", "java.io.FileOutputStream").init(thisPDFFile);
    pageSize = createObject("java", "com.lowagie.text.PageSize").init();
    bidiTable = createObject("java", "com.lowagie.text.pdf.PdfPTable").init(1);
    //one column table
    phrase = createObject("java", "com.lowagie.text.Phrase");
    baseFont = createObject("java", "com.lowagie.text.pdf.BaseFont");
    Font = createObject("java", "com.lowagie.text.Font");
    Phrase=createObject("java", "com.lowagie.text.Phrase");
    // landscape to fit this map image, the rotate() bit
    //pdfDocument = createObject("java",
    "com.lowagie.text.Document").init(PageSize.A4.rotate(), 0, 0, 0, 0);
    // portrait
    pdfDocument = createObject("java",
    "com.lowagie.text.Document").init(PageSize.A4, 0, 0, 0, 0);
    tableCell = createObject("java", "com.lowagie.text.pdf.PdfPCell");
    PdfWriter = createObject("java", "com.lowagie.text.pdf.PdfWriter");
    PdfWriter.getInstance(pdfDocument, pdfFile);
    // add metadata BEFORE opening pdf doc
    pdfDocument.addTitle("This is a quick and dirty arabic ligature test");
    pdfDocument.addSubject("arabic ligature PDF test");
    pdfDocument.addAuthor("PaulH");
    pdfDocument.addCreator("arabicItext testbed");
    pdfDocument.addKeywords("CFMX and iText are a great combination by golly!");
    // lets setup unicode font
    msUnicode=baseFont.createFont("c:
    windows
    fonts
    ARIALUNI.ttf",
    BaseFont.IDENTITY_H, BaseFont.EMBEDDED);
    thisFont=Font.init(msUnicode,12);
    // open doc to add stuff to then close, duh
    pdfDocument.open();
    bidiTable.setWidthPercentage(100);
    bidiTable.setRunDirection(PdfWriter.RUN_DIRECTION_RTL);
    // leading, text, font
    arabicPhrase=phrase.init(2,"نظام بصمة الوجه في دولة",thisFont);
    c=tableCell.init(arabicPhrase);
    c.setArabicOptions(8); //
    c.setBorder(0);
    c.setGrayFill(5.00);
    bidiTable.addCell(c);
    for (i=1; i LTE getU.recordCount;i=i+1) {
         arabicPhrase=phrase.init(22,getU.uniText+,thisFont);
         c=tableCell.init(arabicPhrase);
         c.setArabicOptions(8);
         c.setBorder(0);
         c.setGrayFill(5.00);
         bidiTable.addCell(c);
    pdfDocument.add(bidiTable);
    pdfDocument.close();
    </cfscript

  • Arabic Characters in JSP

    I have an XML file that contains Arabic characters which i am getting from the database. I want my JSP to read this XML file and apply a stylesheet which contain some arabic characters...
    I tried using encoding=windows-1256 and by setting charset=windows-1256...
    Even then, my JSP is unable to read these arabic characters
    Any help on this is appreciated....
    null

    Hi Chris,
    Thanks for your reply.However I still have some problems.
    I couldnt get jpdk 3.0.9.0.4 version the latest version that I
    got was jpdk 3.0.9.0.2.
    I tried the 3.0.9.0.2 version and it gave me the below error.
    Error-
    sun.io.MalformedInputException
         at sun.io.ByteToCharUTF8.convert(ByteToCharUTF8.java,
    Compiled Code)
         at java.io.InputStreamReader.convertInto
    (InputStreamReader.java, Compiled Code)
         at java.io.InputStreamReader.fill
    (InputStreamReader.java, Compiled Code)
         at java.io.InputStreamReader.read
    (InputStreamReader.java, Compiled Code)..........
    Can you guide me regarding this ???
    Regards,
    Mandar.

Maybe you are looking for