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

Problem pdf version 1.4

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Blocker
    • Resolution: Not A Bug
    • Affects Version/s: 2.0.17
    • Fix Version/s: None
    • Component/s: Text extraction
    • Labels:
      None
    • Environment:
      java, maven,

      Description

      Here is my problem. I have to read pdf files and i decided to use pdfbox. I'm using the following code to read my file line by line to execute some actions on each ones :

      File tempFile = "myPdfFile"

      try (PDDocument document = PDDocument.load(tempFile))
      {{color:#cc7832}
      if (!document.isEncrypted())
      {
      PDFTextStripperByArea stripper = new PDFTextStripperByArea(); stripper.setSortByPosition(true); PDFTextStripper tStripper = new PDFTextStripper(); String pdfFileInText = tStripper.getText(document); String lines[] = pdfFileInText.split("
      r?
      n");

      For a pdf in format version 1.7, all is working well. But sometimes, i have to work with pdf version 1.4 and at this moment there is a problem : the PDFTextStripper is unable to read the pdf and my "pdfFileInText" get this value : "\r\n\r\n" and that's all.

       

      I didn't find any solutions on the web.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              Natos33 NathanJ
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: