#1 can't load cmap files

closed-fixed
nobody
None
5
2014-12-09
2008-12-04
No

Hi, I tried jPodRender(5.0.RC3) for displaing japanese PDF.The PDF is EUC-H encoding and TrueType font type0?(attached).
I put EUC-H cmap file(downloaded from adobe) in the classpath.

$(jartop)/cmaps/EUC-H.cmap
/mypackage/MyClass
...

but, it does not work.it fails loading cmap file.

backtrace is here.

----
Exception in thread "AWT-EventQueue-0" de.intarsys.pdf.content.CSError: unexpect
ed exception
at de.intarsys.pdf.content.CSInterpreter.process(CSInterpreter.java:179)
at de.intarsys.pdf.content.CSDeviceBasedInterpreter.process(CSDeviceBase
dInterpreter.java:148)
at jpodtest.PDFCanvas.paint(PDFCanvas.java:92)
at javax.swing.JComponent.paintChildren(JComponent.java:864)
at javax.swing.JComponent.paint(JComponent.java:1036)
at javax.swing.JViewport.paint(JViewport.java:747)
at javax.swing.JComponent.paintChildren(JComponent.java:864)
at javax.swing.JComponent.paint(JComponent.java:1036)
at javax.swing.JComponent.paintToOffscreen(JComponent.java:5122)
at javax.swing.BufferStrategyPaintManager.paint(BufferStrategyPaintManager.java:285)
at javax.swing.RepaintManager.paint(RepaintManager.java:1128)
at javax.swing.JComponent._paintImmediately(JComponent.java:5070)
at javax.swing.JComponent.paintImmediately(JComponent.java:4880)
at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:723)
at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:679)
at javax.swing.RepaintManager.seqPaintDirtyRegions(RepaintManager.java:659)
at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:128)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
Caused by: java.lang.ArrayIndexOutOfBoundsException: 97716
at de.intarsys.pdf.font.CIDFontType2.getGlyphIndex(CIDFontType2.java:89)
at de.intarsys.pdf.font.PDFontType0.getGlyphIndex(PDFontType0.java:175)
at de.intarsys.pdf.platform.cwt.font.freetype.FreetypeFont.loadGlyph(FreetypeFont.java:270)
at de.intarsys.pdf.platform.cwt.font.freetype.FreetypeFont.basicCreate(FreetypeFont.java:67)
at de.intarsys.pdf.platform.cwt.font.freetype.FreetypeFont.createPlatformGlyphs(FreetypeFont.java:189)
at de.intarsys.pdf.platform.cwt.rendering.CSPlatformDevice.basicTextShowGlyphs(CSPlatformDevice.java:217)
at de.intarsys.pdf.content.CSBasicDevice.textShow(CSBasicDevice.java:420)
at de.intarsys.pdf.platform.cwt.rendering.CSPlatformDevice.textShow(CSPlatformDevice.java:683)
at de.intarsys.pdf.content.CSDeviceBasedInterpreter.render_Tj(CSDeviceBasedInterpreter.java:668)
at de.intarsys.pdf.content.CSInterpreter.process(CSInterpreter.java:199)
at de.intarsys.pdf.content.CSInterpreter.process(CSInterpreter.java:173)
... 24 more

----

I suspect following code. "/cmap/" to "cmap/"?

in de.intarsys.pdf.font.NamedCMap.java:64
----
static public CMap loadCMap(COSName name) {
ClassLoader loader = NamedCMap.class.getClassLoader();
InputStream is = loader.getResourceAsStream("/cmaps/"
+ name.stringValue() + ".cmap");
----

I modifed that code with "cmap/" and tested. it's works fine.
is it a bug ? or my misunderstanding(i'm not fulltime java programer.please tell me the right way,in this case)

p.s. using NamedCMap.class.getResourceAsStream works fine, also

regards.

Discussion

  • yusuke mihara

    yusuke mihara - 2008-12-04

    EUC-H encoding PDF

     
  • mtraut

    mtraut - 2008-12-07

    Hi,

    thank you for your hint, we will fix this in the final release.

    but, to be honest: as declared in the method comment, this is completely untested and "not yet implemented" code. We have never used this feature ourselves, this is purely spec driven and you find me amazed that it is working. What i want to say is that it's quite possible you will find some more issues on your way and we are curious to hear about your progress. Would you please direct jPodRenderer related problems to the jPodRenderer project - thank you very much for the snippet.

    BTW. we took the chance to fix the ArrayIndexOutOfBounds that was the cause for the trace, too.

     
  • mtraut

    mtraut - 2008-12-07
    • status: open --> closed-fixed
     
  • yusuke mihara

    yusuke mihara - 2008-12-08

    thank you for your agile response.

    ok, I'll test when released.

    >Would you please direct jPodRenderer related problems to the jPodRenderer
    >project - thank you very much for the snippet.

    excuse me.
    I'll do that next time.

    regards

     
  • yusuke mihara

    yusuke mihara - 2008-12-08
    • status: closed-fixed --> open-fixed
     
  • mtraut

    mtraut - 2010-06-25
    • status: open-fixed --> closed-fixed
     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks