Skip to content

Simply reading and saving without any opeartions on the attached PDF file causes data loss #99

@kovidgoyal

Description

@kovidgoyal
  • I'm submitting a:

    • Vulnerability report -> use the specific form instead!
    • [x ] Bug report
    • Feature request/suggestion
  • [Bug report] What is the current behavior?
    Reading the PDF file into a PDFMemdocument and then writing it out to a new PDF file reduces the size from ~4MB to 40KB and the images are lost.

  • [Bug report] What is the expected behavior?

There is no significant file size reduction and the visual appearance of the exported PDF file is identical to the original.

  • [Bug report] Please provide the steps to reproduce and if possible a minimal reproduction code of the problem
    Call PdfMemeDocument::Load() then call PdfMemDocument::Save()

Note that loading the document reports a warning:
PoDoFoWARNING: Found object with reference 0 0 R different than reported 46 0 R in XRef sections

This probably means the PDF file is corrupted, but it is rendered correctly by every PDF program I tried. PoDoFo should ideally handle the corruption or throw an exception when trying to write instead of silently discarding the data.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions