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

Bad characters in PDF

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.0.15
    • None
    • PDModel
    • None
    • Open JDK 11.0.4.11.1

    Description

      Our application uses PDFBox 2.0.15 for PDF processing. We have recently upgrade PDFBox version and Java 8. Now, we are using Open JDK 11.0.4.11.1.

      The application flow is when we receive the PDF, we add the blank page in the end of the PDF and save it. (This is simple use case).

      We have observed two times this issue in last one month, The text of the PDF get change to alphanumeric numbers as shown in the attached picture.

       

      Kindly assist.

       

      Here is the sample code that we are using - 

      String fileName = "84413_196751_0.pdf";

      PDDocument pdDocument = PDDocument.load(new File(fileName));

      File file = new File(fileName);

      try

      { // Add Page into PDF PDPage newPage = *new* PDPage(); pdDocument.addPage(newPage); File preparedFile = DocumentUtil._getPreparedFile_(*new* File(fileName)); pdDocument.save(preparedFile);  }

      catch (Exception e)

      {             System.*_out_*.println("Error in preparing document "); }

      Attachments

        1. PastedGraphic-1-4.png
          1.37 MB
          Navdeep

        Activity

          People

            Unassigned Unassigned
            NavdeepSharma Navdeep
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: