Uploaded image for project: 'PDFBox'
  1. PDFBox
  2. PDFBOX-2073

PDF files with unusual Japanese font can not be rewrite correctly

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 1.8.5, 1.8.6, 2.0.0
    • Fix Version/s: 1.8.6, 2.0.0
    • Component/s: None
    • Labels:
    • Environment:
      Windows 7 32bit

      Description

      While rotate attached pdf file, The Japanese characters cannot display in the output pdf file.
      This problem can also occur when marge PDF files.
      We suspect that this caused by the name of font type.

      Environment
      -------------------------------------------------
      OS : Windows 7 (32bit)
      jvm : 1.6
      pdfbox: 1.8.5
      -------------------------------------------------

      Code to reproduce the problem
      -------------------------------------------------
      public static void main(String[] args) {

      String filePath = "D:\\test
      landscape.pdf";
      String newPDFFile = "D:\\test
      new_landscape.pdf";

      try {
      PDDocument rotatedDocument = PDDocument.load(filePath);
      PDDocument document = new PDDocument();

      int pageNumber = document.getNumberOfPages();
      for (int i=0; i<pageNumber; i++)

      { PDPage page = (PDPage)document.getDocumentCatalog().getAllPages().get(i); page.setRotation(-90); rotatedDocument.addPage(page); }

      rotatedDocument.save(newPDFFile);

      document.close();
      rotatedDocument.close();
      } catch (Exception e)

      { e.printStackTrace(); }

      }
      -------------------------------------------------

        Attachments

        1. font_screenshot1.png
          30 kB
          Tilman Hausherr
        2. landscape.pdf
          8 kB
          May Yu
        3. pdf_property.png
          110 kB
          May Yu

          Activity

            People

            • Assignee:
              tilman Tilman Hausherr
              Reporter:
              May 2014 May Yu
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: