Re: [Ikvm-developers] 7.3.4830: TTF font issue?
Brought to you by:
jfrijters
|
From: Jeroen F. <je...@su...> - 2013-10-12 15:08:34
|
Hi Jason, Thanks for the off-list repro. I look at it briefly and found that at least in your repro, the problem is caused by the .NET GC being more aggresive than Java and it closes the document before it is done (this is also extremely bad API design by pdfbox, if this is indeed by design). The workaround is to explicitly call pdDoc.close() at the end of the code, but unfortunately then you'll notice that it runs into an unsupported area of IKVM as it tries to create a sun.font.StandardGlyphVector and you get an ikvm.internal.NotYetImplementedError. Regards, Jeroen > -----Original Message----- > From: Jason Harrop [mailto:ja...@pl...] > Sent: Saturday, October 12, 2013 0:08 > To: ikv...@li... > Subject: [Ikvm-developers] 7.3.4830: TTF font issue? > > Hi, I'm trying to use PDFBox 1.8.2 as a DLL via IKVM. > > It throws the following exception: > > java.io.IOException: Unexpected end of TTF stream reached > at > org.apache.fontbox.ttf.TTFDataStream.read(TTFDataStream.java:221) > at > org.apache.fontbox.ttf.TTFDataStream.readString(TTFDataStream.java:69) > at > org.apache.fontbox.ttf.TTFDataStream.readString(TTFDataStream.java:57) > at > org.apache.fontbox.ttf.AbstractTTFParser.readTableDirectory(AbstractTTFP > arser.java:214) > at > org.apache.fontbox.ttf.AbstractTTFParser.parseTTF(AbstractTTFParser.java > :85) > at org.apache.fontbox.ttf.TTFParser.parseTTF(TTFParser.java:26) > at > org.apache.fontbox.ttf.AbstractTTFParser.parseTTF(AbstractTTFParser.java > :66) > at org.apache.fontbox.ttf.TTFParser.parseTTF(TTFParser.java:26) > at > org.apache.pdfbox.pdmodel.font.PDTrueTypeFont.rebuildTTF(PDTrueTypeFont. > java:517) > at > org.apache.pdfbox.pdmodel.font.PDTrueTypeFont.getawtFont(PDTrueTypeFont. > java:456) > at > org.apache.pdfbox.pdmodel.font.PDSimpleFont.drawString(PDSimpleFont.java > :109) > at > org.apache.pdfbox.pdfviewer.PageDrawer.processTextPosition(PageDrawer.ja > va:235) > at > org.apache.pdfbox.util.PDFStreamEngine.processEncodedText(PDFStreamEngin > e.java:388) > at > org.apache.pdfbox.util.operator.ShowTextGlyph.process(ShowTextGlyph.java > :48) > at > org.apache.pdfbox.util.PDFStreamEngine.processOperator(PDFStreamEngine.j > ava:554) > at > org.apache.pdfbox.util.PDFStreamEngine.processSubStream(PDFStreamEngine. > java:269) > at > org.apache.pdfbox.util.PDFStreamEngine.processSubStream(PDFStreamEngine. > java:235) > at > org.apache.pdfbox.util.PDFStreamEngine.processStream(PDFStreamEngine.jav > a:216) > at > org.apache.pdfbox.pdfviewer.PageDrawer.drawPage(PageDrawer.java:127) > at > org.apache.pdfbox.pdmodel.PDPage.convertToImage(PDPage.java:783) > at > org.apache.pdfbox.pdmodel.PDPage.convertToImage(PDPage.java:712) > > Any suggestions what to do about this? > > Needless to say the convertToImage method executed in Oracle Java > implementation on the same PDF on the same PC works fine. > > thanks .. Jason > > ------------------------------------------------------------------------ > ------ > October Webinars: Code for Performance > Free Intel webinars can help you accelerate application performance. > Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most > from the latest Intel processors and coprocessors. See abstracts and > register > > http://pubads.g.doubleclick.net/gampad/clk?id=60134071&iu=/4140/ostg.clk > trk > _______________________________________________ > Ikvm-developers mailing list > Ikv...@li... > https://lists.sourceforge.net/lists/listinfo/ikvm-developers |