Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't save anything to a file #147

Open
lokman2k5 opened this issue Sep 18, 2024 · 1 comment
Open

Can't save anything to a file #147

lokman2k5 opened this issue Sep 18, 2024 · 1 comment

Comments

@lokman2k5
Copy link

Describe the bug
I get Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException: class com.itextpdf.kernel.pdf.PdfIndirectReference cannot be cast to class com.itextpdf.kernel.pdf.PdfStream (com.itextpdf.kernel.pdf.PdfIndirectReference and com.itextpdf.kernel.pdf.PdfStream are in unnamed module of loader 'app') at com.itextpdf.rups.view.contextmenu.SaveToFilePdfTreeAction$1.run(SaveToFilePdfTreeAction.java:97) at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318) at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:773) at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:720) at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:714) at java.base/java.security.AccessController.doPrivileged(AccessController.java:400) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:87) at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:742) at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203) at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124) at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113) at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109) at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90) Whenever I try 'save to file' or 'save raw bytes to file'

I am on Fedora 40, java --version: openjdk 21.0.4 2024-07-16 OpenJDK Runtime Environment (Red_Hat-21.0.4.0.7-2) (build 21.0.4+7) OpenJDK 64-Bit Server VM (Red_Hat-21.0.4.0.7-2) (build 21.0.4+7, mixed mode, sharing)

@Eswcvlad
Copy link
Contributor

Is this on the 7.2.5 version or on the develop branch version?

As of 7.2.5 you can only save PDF streams, and everything else throws an exception like this... It looks like you were trying to save a "reference" node, not a stream.

On the develop branch version this should be fixed and it should gray-out the option, if it doesn't support saving a particular node. And it also should allow to save PDF strings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants