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

Cast error class com.lowagie.text.pdf.PRIndirectReference cannot be cast to class com.lowagie.text.pdf.PdfDictionary #729

Closed
koenvb opened this issue May 13, 2022 · 0 comments · Fixed by #730
Labels
Milestone

Comments

@koenvb
Copy link

koenvb commented May 13, 2022

Describe the bug

When reading a pdf generated by Adobe Illustrator the code hangs on a casting error.
This is due to wrong casting from PRIndirectReference to PdfDictionary

Exception in thread "main" java.lang.ClassCastException: class com.lowagie.text.pdf.PRIndirectReference cannot be cast to class com.lowagie.text.pdf.PdfDictionary (com.lowagie.text.pdf.PRIndirectReference and com.lowagie.text.pdf.PdfDictionary are in unnamed module of loader 'app')
	at com.lowagie.text.pdf.PdfWriter.addASEvent(PdfWriter.java:2492)
	at com.lowagie.text.pdf.PdfWriter.fillOCProperties(PdfWriter.java:2557)
	at com.lowagie.text.pdf.PdfStamperImp.close(PdfStamperImp.java:196)
	at com.lowagie.text.pdf.PdfStamper.close(PdfStamper.java:246)

To Reproduce
Code to reproduce the issue

  1. Sample Code
  2. Unit-Test

Expected behavior

pdfWriter just goes on without any issue

System (please complete the following information):

  • OS: [e.g. iOS]
  • Used Font:

Additional context
Add any other context about the problem here.

@koenvb koenvb added the bug label May 13, 2022
koenvb added a commit to koenvb/OpenPDF that referenced this issue May 13, 2022
@asturio asturio linked a pull request May 31, 2022 that will close this issue
2 tasks
@asturio asturio added this to the 1.3.29 milestone May 31, 2022
asturio pushed a commit that referenced this issue May 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants