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

Exception while reading text file using createPDFFromText of apache pdfbox 2.0.6 version

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Won't Fix
    • 2.0.6
    • None
    • None
    • None
    • Windows 7, java 1.8 version

    Description

      While using createPDFFromText() of TextToPDF, throwing exception when tab comes while reading text file. Attached is the java(PDFToText.java) sample program which I am executing and sample data text file (sampleTextRead2.txt) which is being read.

      Below is the exception while executing :-

      Exception in thread "main" java.lang.IllegalArgumentException: U+0009 ('controlHT') is not available in this font Helvetica encoding: WinAnsiEncoding
      at org.apache.pdfbox.pdmodel.font.PDType1Font.encode(PDType1Font.java:425)
      at org.apache.pdfbox.pdmodel.font.PDFont.encode(PDFont.java:323)
      at org.apache.pdfbox.pdmodel.font.PDFont.getStringWidth(PDFont.java:352)
      at org.apache.pdfbox.tools.TextToPDF.createPDFFromText(TextToPDF.java:197)
      at org.apache.pdfbox.tools.TextToPDF.createPDFFromText(TextToPDF.java:98)
      at PDFStripper.PDFToText.main(PDFToText.java:23)

      Attachments

        1. sampleTextRead2.txt
          0.3 kB
          Varun Joshi
        2. PDFToText.java
          1 kB
          Varun Joshi

        Issue Links

          Activity

            People

              Unassigned Unassigned
              varunj78 Varun Joshi
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: