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

Building pdfbox 1.8.6 or 1.8.7 using IKVM

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • 1.8.6, 1.8.7
    • None
    • .NET, FontBox, Text extraction
    • Windows 8.1 Pro, IKVM 8.0.5415 or IKVM 7.2.4630.5, JDK 7 (or 8) 64 bit, .NET 4.0

    Description

      I tried to build pdfbox 1.8.6 (and 1.8.7) using IKVM according to this instructions. Everything went fine, but If I tested this code below on some pdf (e.g. PDF) I get exception on line with writeText. If I tested the same with pdfbox 1.8.5 I had no problems.

      class MyPDFTextStripper : PDFTextStripper {
        ...
        java.io.StringWriter outputStream = new java.io.StringWriter();
        writeText(document, outputStream);   // Exception
        ...
      }
      
      Exception:
      
      An unhandled exception of type 'System.TypeInitializationException' 
      occurred in pdfbox-1.8.7.dll
      
      Additional information: The type initializer for 
      'org.apache.fontbox.cmap.CMap' threw an exception.
      
      Stack trace:
         at org.apache.fontbox.cmap.CMap..ctor()
         at org.apache.fontbox.cmap.CMapParser.parse(String resourceRoot, InputStream input)
         at org.apache.pdfbox.pdmodel.font.PDFont.parseCmap(String cmapRoot, InputStream cmapStream)
         at org.apache.pdfbox.pdmodel.font.PDSimpleFont.extractToUnicodeEncoding()
         at org.apache.pdfbox.pdmodel.font.PDSimpleFont.determineEncoding()
         at org.apache.pdfbox.pdmodel.font.PDType1Font.determineEncoding()
         at org.apache.pdfbox.pdmodel.font.PDFont..ctor(COSDictionary fontDictionary)
         at org.apache.pdfbox.pdmodel.font.PDSimpleFont..ctor(COSDictionary fontDictionary)
         at org.apache.pdfbox.pdmodel.font.PDType1Font..ctor(COSDictionary fontDictionary)
         at org.apache.pdfbox.pdmodel.font.PDFontFactory.createFont(COSDictionary dic)
         at org.apache.pdfbox.pdmodel.PDResources.getFonts()
         at org.apache.pdfbox.util.PDFStreamEngine.getFonts()
         at org.apache.pdfbox.util.operator.SetTextFont.process(PDFOperator operator, List arguments)
         at org.apache.pdfbox.util.PDFStreamEngine.processOperator(PDFOperator operator, List arguments)
         at org.apache.pdfbox.util.PDFStreamEngine.processSubStream(COSStream )
         at org.apache.pdfbox.util.PDFStreamEngine.processSubStream(PDPage aPage, PDResources resources, COSStream cosStream)
         at org.apache.pdfbox.util.PDFStreamEngine.processStream(PDPage aPage, PDResources resources, COSStream cosStream)
         at org.apache.pdfbox.util.PDFTextStripper.processPage(PDPage page, COSStream content)
         at org.apache.pdfbox.util.PDFTextStripper.processPages(List pages)
         at org.apache.pdfbox.util.PDFTextStripper.writeText(PDDocument doc, Writer outputStream)
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              majo Marian Mar
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: