Uploaded image for project: 'PDFBox'
  1. PDFBox
  2. PDFBOX-3642

java.lang.ClassCastException is thrown when flattening form with a picture

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.4
    • Fix Version/s: 2.0.5, 3.0.0 PDFBox
    • Component/s: AcroForm
    • Labels:
      None

      Description

      Without picture in the form flattening works ok. With picture the following exception is thrown:

      Exception in thread "main" java.lang.ClassCastException: org.apache.pdfbox.pdmodel.graphics.image.PDImageXObject cannot be cast to org.apache.pdfbox.pdmodel.graphics.form.PDFormXObject
      at org.apache.pdfbox.pdmodel.interactive.form.PDAcroForm.resolveNeedsTranslation(PDAcroForm.java:726)
      at org.apache.pdfbox.pdmodel.interactive.form.PDAcroForm.flatten(PDAcroForm.java:276)
      at org.apache.pdfbox.pdmodel.interactive.form.PDAcroForm.flatten(PDAcroForm.java:192)
      at test.FlattenIssue.main(FlattenIssue.java:27)

      Attaching source PDF form (generated in open office).

        Attachments

          Activity

            People

            • Assignee:
              msahyoun Maruan Sahyoun
              Reporter:
              rumburak rumburak
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: