Maven 1.x PDF Plugin
  1. Maven 1.x PDF Plugin
  2. MPPDF-22

Allow copy and paste from pdf to text editor

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.3
    • Fix Version/s: 2.4
    • Labels:
      None
    • Environment:
      Maven xdoc 1.9
    • Number of attachments :
      3

      Description

      Actually, we cant copy text from a PDF section and paste it in a text editor.
      But we can do it for title section or table of contents...

      Example:
      copy this title from the generated PDF: "Table of Contents"
      paste in a text editor: Table of Contents
      Correct

      copy this section from the generated PDF: "No current items"
      paste in a text editor: ".... .............. ............"
      In hexa it should be:
      00000000h: 2E 2E 2E 2E 20 2E 2E 2E 2E 2E 2E 2E 2E 2E 2E 2E ; .... ...........
      00000010h: 2E 2E 2E 20 2E 2E 2E 2E 2E 2E 2E 2E 2E 2E 2E 2E ; ... ............
      Thus incorrect

      Maybe a font problem...

      1. ttf-gara.xml
        28 kB
        Lukas Theussl
      2. ttf-garabd.xml
        28 kB
        Lukas Theussl
      3. ttf-garait.xml
        27 kB
        Lukas Theussl

        Activity

        Hide
        Lukas Theussl added a comment -

        Seems to be a font problem indeed.

        If I comment out the line

        <ant:setProperty name="userconfig" value="$

        {internal_pdf_workingDir}

        /userconfig.xml" />

        from the pdf:pdf goal in plugin.jelly (userconfig.xml just defines some fonts), then I can do copy and paste from everywhere.
        With this line included, I have the following error message when trying to do a copy/paste:

        (acroread:5874): Gdk-WARNING **: Error converting from UTF-8 to STRING: Invalid byte sequence in conversion input

        So it must be a problem with one of the fonts in plugin-resources/fonts/. Are those necessary?

        Show
        Lukas Theussl added a comment - Seems to be a font problem indeed. If I comment out the line <ant:setProperty name="userconfig" value="$ {internal_pdf_workingDir} /userconfig.xml" /> from the pdf:pdf goal in plugin.jelly (userconfig.xml just defines some fonts), then I can do copy and paste from everywhere. With this line included, I have the following error message when trying to do a copy/paste: (acroread:5874): Gdk-WARNING **: Error converting from UTF-8 to STRING: Invalid byte sequence in conversion input So it must be a problem with one of the fonts in plugin-resources/fonts/. Are those necessary?
        Hide
        Lukas Theussl added a comment -

        I attach three font metrics files that solve this issue for me. I recreated these files from the .ttf files included in the current pdf plugin, using fop's TTFReader with the '-enc ansi' option. From the fop documentation (http://xml.apache.org/fop/fonts.html#truetype-metrics), the WinAnsi encoding is necessary for cut-and-paste and other operations.

        Show
        Lukas Theussl added a comment - I attach three font metrics files that solve this issue for me. I recreated these files from the .ttf files included in the current pdf plugin, using fop's TTFReader with the '-enc ansi' option. From the fop documentation ( http://xml.apache.org/fop/fonts.html#truetype-metrics ), the WinAnsi encoding is necessary for cut-and-paste and other operations.
        Hide
        Arnaud Heritier added a comment -

        Fonts settings replaced. Fixed.

        Show
        Arnaud Heritier added a comment - Fonts settings replaced. Fixed.

          People

          • Assignee:
            Arnaud Heritier
            Reporter:
            Vincent Siveton
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: