pcorless / icepdf

PDF Rendering and Viewing API in Java
Apache License 2.0
84 stars 21 forks source link

ice pdf 7.2.1 #368

Closed didiermaurel closed 3 months ago

didiermaurel commented 3 months ago

good morning

it no longer works with this version I have this error and a blank page

Regards

Didier Maurel

java.lang.NoClassDefFoundError: org/apache/pdfbox/io/RandomAccessReadBuffer at org.icepdf.core.pobjects.fonts.zfont.fontFiles.ZFontTrueType.(ZFontTrueType.java:60) ~[icepdf-core-7.2.1.jar:7.2.1] at org.icepdf.core.pobjects.fonts.zfont.fontFiles.ZFontTrueType.(ZFontTrueType.java:53) ~[icepdf-core-7.2.1.jar:7.2.1] at org.icepdf.core.pobjects.fonts.FontFactory.createFontFile(FontFactory.java:119) ~[icepdf-core-7.2.1.jar:7.2.1] at org.icepdf.core.pobjects.fonts.FontDescriptor.init(FontDescriptor.java:292) ~[icepdf-core-7.2.1.jar:7.2.1] at org.icepdf.core.pobjects.fonts.Font.parseFontDescriptor(Font.java:298) ~[icepdf-core-7.2.1.jar:7.2.1] at org.icepdf.core.pobjects.fonts.zfont.SimpleFont.init(SimpleFont.java:64) ~[icepdf-core-7.2.1.jar:7.2.1] at org.icepdf.core.pobjects.fonts.zfont.TrueTypeFont.init(TrueTypeFont.java:20) ~[icepdf-core-7.2.1.jar:7.2.1] at org.icepdf.core.pobjects.Resources.getFont(Resources.java:171) ~[icepdf-core-7.2.1.jar:7.2.1] at org.icepdf.core.util.parser.content.AbstractContentParser.consume_Tf(AbstractContentParser.java:820) ~[icepdf-core-7.2.1.jar:7.2.1] at org.icepdf.core.util.parser.content.ContentParser.parseText(ContentParser.java:743) ~[icepdf-core-7.2.1.jar:7.2.1] at org.icepdf.core.util.parser.content.ContentParser.parse(ContentParser.java:149) ~[icepdf-core-7.2.1.jar:7.2.1] at org.icepdf.core.pobjects.Page.init(Page.java:441) ~[icepdf-core-7.2.1.jar:7.2.1] at org.icepdf.core.pobjects.Page.init(Page.java:381) ~[icepdf-core-7.2.1.jar:7.2.1] at org.icepdf.core.pobjects.Page.getViewText(Page.java:1521) ~[icepdf-core-7.2.1.jar:7.2.1] at org.icepdf.ri.common.tools.TextSelection.selectionTextSelectIcon(TextSelection.java:248) ~[icepdf-viewer-7.2.1.jar:7.2.1] at org.icepdf.ri.common.tools.TextSelectionViewHandler.mouseMoved(TextSelectionViewHandler.java:281) ~[icepdf-viewer-7.2.1.jar:7.2.1] at java.awt.AWTEventMulticaster.mouseMoved(AWTEventMulticaster.java:338) ~[?:?] at java.awt.Component.processMouseMotionEvent(Component.java:6666) ~[?:?] at javax.swing.JComponent.processMouseMotionEvent(JComponent.java:3416) ~[?:?] at java.awt.Component.processEvent(Component.java:6390) ~[?:?] at java.awt.Container.processEvent(Container.java:2266) ~[?:?] at java.awt.Component.dispatchEventImpl(Component.java:4996) ~[?:?] at java.awt.Container.dispatchEventImpl(Container.java:2324) ~[?:?] at java.awt.Component.dispatchEvent(Component.java:4828) ~[?:?] at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4948) ~[?:?] at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4588) ~[?:?] at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4516) ~[?:?] at java.awt.Container.dispatchEventImpl(Container.java:2310) ~[?:?] at java.awt.Window.dispatchEventImpl(Window.java:2780) ~[?:?] at java.awt.Component.dispatchEvent(Component.java:4828) ~[?:?] at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:775) [?:?] at java.awt.EventQueue$4.run(EventQueue.java:720) [?:?] at java.awt.EventQueue$4.run(EventQueue.java:714) [?:?] at java.security.AccessController.doPrivileged(AccessController.java:400) ~[?:?] at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:87) ~[?:?] at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:98) ~[?:?] at java.awt.EventQueue$5.run(EventQueue.java:747) ~[?:?] at java.awt.EventQueue$5.run(EventQueue.java:745) ~[?:?] at java.security.AccessController.doPrivileged(AccessController.java:400) ~[?:?] at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:87) ~[?:?] at java.awt.EventQueue.dispatchEvent(EventQueue.java:744) ~[?:?] at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203) ~[?:?] at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124) ~[?:?] at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:117) ~[?:?] at java.awt.WaitDispatchSupport$2.run(WaitDispatchSupport.java:191) ~[?:?] at java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:236) ~[?:?] at java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:234) ~[?:?] at java.security.AccessController.doPrivileged(AccessController.java:319) [?:?] at java.awt.WaitDispatchSupport.enter(WaitDispatchSupport.java:234) ~[?:?] at java.awt.Dialog.show(Dialog.java:1079) ~[?:?] at java.awt.Component.show(Component.java:1728) ~[?:?] at java.awt.Component.setVisible(Component.java:1675) ~[?:?] at java.awt.Window.setVisible(Window.java:1036) ~[?:?] at java.awt.Dialog.setVisible(Dialog.java:1015) ~[?:?] at isc.appli.onco.OncoGUI.setVisible(OncoGUI.java:107) ~[classes/:?] at isc.appli.onco.OncoGUI$2.run(OncoGUI.java:96) ~[classes/:?] at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318) ~[?:?] at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:773) ~[?:?] at java.awt.EventQueue$4.run(EventQueue.java:720) ~[?:?] at java.awt.EventQueue$4.run(EventQueue.java:714) ~[?:?] at java.security.AccessController.doPrivileged(AccessController.java:400) [?:?] at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:87) [?:?] at java.awt.EventQueue.dispatchEvent(EventQueue.java:742) [?:?] at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203) [?:?] at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124) [?:?] at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113) [?:?] at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109) [?:?] at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) [?:?] at java.awt.EventDispatchThread.run(EventDispatchThread.java:90) [?:?] Caused by: java.lang.ClassNotFoundException: org.apache.pdfbox.io.RandomAccessReadBuffer ... 69 more

pcorless commented 3 months ago

The pdfbox 3.x dependency introduced a new dependency on the pdfbox-io.jar. This should come in automatically with the maven or gradle build dependencies but this will depend on your tooling.

didiermaurel commented 3 months ago

i went to 3.0.3 version of pdfbox and i add in my pom.xml

org.apache.pdfbox io 3.0.0-alpha3

but i have this error below and always the blank page

java.lang.NoSuchMethodError: 'org.apache.fontbox.ttf.TrueTypeFont org.apache.fontbox.ttf.TTFParser.parse(java.io.InputStream)' at org.icepdf.core.pobjects.fonts.zfont.fontFiles.ZFontTrueType.(ZFontTrueType.java:60) ~[icepdf-core-7.2.0.jar:7.2.0] at org.icepdf.core.pobjects.fonts.zfont.fontFiles.ZFontTrueType.(ZFontTrueType.java:53) ~[icepdf-core-7.2.0.jar:7.2.0] at org.icepdf.core.pobjects.fonts.FontFactory.createFontFile(FontFactory.java:119) ~[icepdf-core-7.2.0.jar:7.2.0] at org.icepdf.core.pobjects.fonts.FontDescriptor.init(FontDescriptor.java:292) ~[icepdf-core-7.2.0.jar:7.2.0] at org.icepdf.core.pobjects.fonts.Font.parseFontDescriptor(Font.java:298) ~[icepdf-core-7.2.0.jar:7.2.0] at org.icepdf.core.pobjects.fonts.zfont.SimpleFont.init(SimpleFont.java:64) ~[icepdf-core-7.2.0.jar:7.2.0] at org.icepdf.core.pobjects.fonts.zfont.TrueTypeFont.init(TrueTypeFont.java:20) ~[icepdf-core-7.2.0.jar:7.2.0] at org.icepdf.core.pobjects.Resources.getFont(Resources.java:171) ~[icepdf-core-7.2.0.jar:7.2.0] at org.icepdf.core.util.parser.content.AbstractContentParser.consume_Tf(AbstractContentParser.java:820) ~[icepdf-core-7.2.0.jar:7.2.0] at org.icepdf.core.util.parser.content.ContentParser.parseText(ContentParser.java:743) ~[icepdf-core-7.2.0.jar:7.2.0] at org.icepdf.core.util.parser.content.ContentParser.parse(ContentParser.java:149) ~[icepdf-core-7.2.0.jar:7.2.0] at org.icepdf.core.pobjects.Page.init(Page.java:441) ~[icepdf-core-7.2.0.jar:7.2.0] at org.icepdf.core.pobjects.Page.init(Page.java:381) ~[icepdf-core-7.2.0.jar:7.2.0] at org.icepdf.core.pobjects.Page.getViewText(Page.java:1521) ~[icepdf-core-7.2.0.jar:7.2.0] at org.icepdf.ri.common.tools.TextSelection.selectionTextSelectIcon(TextSelection.java:248) ~[icepdf-viewer-7.2.0.jar:7.2.0] at org.icepdf.ri.common.tools.TextSelectionViewHandler.mouseMoved(TextSelectionViewHandler.java:280) ~[icepdf-viewer-7.2.0.jar:7.2.0] at java.awt.AWTEventMulticaster.mouseMoved(AWTEventMulticaster.java:338) ~[?:?] at java.awt.Component.processMouseMotionEvent(Component.java:6666) ~[?:?] at javax.swing.JComponent.processMouseMotionEvent(JComponent.java:3416) ~[?:?] at java.awt.Component.processEvent(Component.java:6390) ~[?:?] at java.awt.Container.processEvent(Container.java:2266) ~[?:?] at java.awt.Component.dispatchEventImpl(Component.java:4996) ~[?:?] at java.awt.Container.dispatchEventImpl(Container.java:2324) ~[?:?] at java.awt.Component.dispatchEvent(Component.java:4828) ~[?:?] at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4948) ~[?:?] at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4588) ~[?:?] at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4516) ~[?:?] at java.awt.Container.dispatchEventImpl(Container.java:2310) ~[?:?] at java.awt.Window.dispatchEventImpl(Window.java:2780) ~[?:?] at java.awt.Component.dispatchEvent(Component.java:4828) ~[?:?] at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:775) [?:?] at java.awt.EventQueue$4.run(EventQueue.java:720) [?:?] at java.awt.EventQueue$4.run(EventQueue.java:714) [?:?] at java.security.AccessController.doPrivileged(AccessController.java:400) ~[?:?] at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:87) ~[?:?] at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:98) ~[?:?] at java.awt.EventQueue$5.run(EventQueue.java:747) ~[?:?] at java.awt.EventQueue$5.run(EventQueue.java:745) ~[?:?] at java.security.AccessController.doPrivileged(AccessController.java:400) ~[?:?] at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:87) ~[?:?] at java.awt.EventQueue.dispatchEvent(EventQueue.java:744) ~[?:?] at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203) ~[?:?] at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124) ~[?:?] at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:117) ~[?:?] at java.awt.WaitDispatchSupport$2.run(WaitDispatchSupport.java:191) ~[?:?] at java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:236) ~[?:?] at java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:234) ~[?:?] at java.security.AccessController.doPrivileged(AccessController.java:319) [?:?] at java.awt.WaitDispatchSupport.enter(WaitDispatchSupport.java:234) ~[?:?] at java.awt.Dialog.show(Dialog.java:1079) ~[?:?] at java.awt.Component.show(Component.java:1728) ~[?:?] at java.awt.Component.setVisible(Component.java:1675) ~[?:?] at java.awt.Window.setVisible(Window.java:1036) ~[?:?] at java.awt.Dialog.setVisible(Dialog.java:1015) ~[?:?] at isc.appli.onco.OncoGUI.setVisible(OncoGUI.java:107) ~[classes/:?] at isc.appli.onco.OncoGUI$2.run(OncoGUI.java:96) ~[classes/:?] at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318) ~[?:?] at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:773) ~[?:?] at java.awt.EventQueue$4.run(EventQueue.java:720) ~[?:?] at java.awt.EventQueue$4.run(EventQueue.java:714) ~[?:?] at java.security.AccessController.doPrivileged(AccessController.java:400) [?:?] at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:87) [?:?] at java.awt.EventQueue.dispatchEvent(EventQueue.java:742) [?:?] at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203) [?:?] at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124) [?:?] at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113) [?:?] at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109) [?:?] at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) [?:?] at java.awt.EventDispatchThread.run(EventDispatchThread.java:90) [?:?] [AWT-EventQueue-0] à 16:46:56,034, classe: LogUtil$1,ligne 57 >> UncaughtException (AWT-EventQueue-0) j

pcorless commented 3 months ago

Can you try mvn clean, I'm seeing 7.2.0 jars on the stack trace. The icepdf 7.2.1 jars are still propagating on maven central so they might not be available in your region yet.

Unfortunately 7.2.0 won't run with fontbox 3.0, there were breaking api changes

didiermaurel commented 3 months ago

yes it works !!!

thank you very much

pcorless commented 3 months ago

Marking as resolved.