You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Marian Mar (JIRA)" <ji...@apache.org> on 2014/12/05 00:56:12 UTC

[jira] [Created] (PDFBOX-2544) Building pdfbox 1.8.6 or 1.8.7 using IKVM

Marian Mar created PDFBOX-2544:
----------------------------------

             Summary: Building pdfbox 1.8.6 or 1.8.7 using IKVM
                 Key: PDFBOX-2544
                 URL: https://issues.apache.org/jira/browse/PDFBOX-2544
             Project: PDFBox
          Issue Type: Bug
          Components: .NET, FontBox, Text extraction
    Affects Versions: 1.8.7, 1.8.6
         Environment: Windows 8.1 Pro, IKVM 8.0.5415 or IKVM 7.2.4630.5, JDK 7 (or 8) 64 bit, .NET 4.0
            Reporter: Marian Mar


I tried to build pdfbox 1.8.6 (and 1.8.7) using IKVM according to this http://stackoverflow.com/questions/8441991/how-to-build-pdfbox-for-net instructions. Everything went fine, but If I tested this code below on some pdf (e.g. http://www.energy.umich.edu/sites/default/files/pdf-sample.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
  ...
}

Exceprtion:

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)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)