Skip to content

invalid media box causes output to be all blank #26

@allchannelson

Description

@allchannelson

I have a PDF file that seems to have an invalid media box. The file opens fine using Adobe PDF reader, so I assume there's a standard default being used.

I can't provide the original file since it has sensitive information on it, and when I edit it, it "corrects" for the error.

I do I have a verbose output capture, and I can provide the output PDF.

markpdf bad.pdf "Test" bad_output.pdf --opacity=1 --font-size=12 --offset-x=10 --offset-y=10 -v
2023/01/03 14:30:05 Input PDF: bad.pdf
2023/01/03 14:30:05 No file exists at: Test, assuming Text Watermark.
[DEBUG]  parser.go:1530 Pdf version 1.7
[DEBUG]  main.go:131 Failed to get page mediabox: Invalid media box
2023/01/03 14:30:05 Page Width       : 0
2023/01/03 14:30:05 Page Height      : 0
2023/01/03 14:30:05 Paragraph width: 19.450000
2023/01/03 14:30:05 Paragraph height: 10.000000
2023/01/03 14:30:05 Offsets x: 10.000000, y: 10.000000

bad_output.pdf

I'll see if I can get the source code to work and hard-code some values and see if that makes a difference.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions