ajaxray / ajaxray/markpdf

invalid media box causes output to be all blank

Offen
#26 2 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Go
Sterne
211
Forks
42
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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](https://github.com/ajaxray/markpdf/files/10334621/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.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.