[Poppler-bugs] [Bug 107057] [Patch] Skip XRef gaps in PDFDoc save methods

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Thu Jun 28 21:23:05 UTC 2018


https://bugs.freedesktop.org/show_bug.cgi?id=107057

--- Comment #1 from Tobias Deiminger <haxtibal at posteo.de> ---
(In reply to Tobias Deiminger from comment #0)
> Poppler regression tests are yet outstanding.

All regression tests (that I'm aware of) are done now. Everything passes /
behaves as expected.

# Automated tests pass
poppler$ make test
Running tests...
Test project /home/deiminge/cmake/poppler
      Start  1: check_qt5_attachments
 1/17 Test  #1: check_qt5_attachments ............   Passed    0.08 sec
... snip ...
17/17 Test #17: check_qt5_strings ................   Passed    0.02 sec

100% tests passed, 0 tests failed out of 17

Total Test time (real) =   0.83 sec


# Incremental update of *.pdf from poppler unittest documents works
# (exclude encrypted for loop simplicity)
test$ good=0; for f in ~/git/test/unittestcases/*.pdf; do [[ "$f" ==
*Encrypted* ]] || [[ "$f" == *Gday*open* ]] && continue; ./pdf-fullrewrite
-check -i "$f" out.pdf && good=$((good+1)) || echo "$f failed"; done; echo
"Passed: $good"
Passed: 20


# Full rewrite of *.pdf from poppler unittest documents
# (exclude encrypted for loop simplicity)
test$ good=0; for f in ~/git/test/unittestcases/*.pdf; do [[ "$f" ==
*Encrypted* ]] || [[ "$f" == *Gday*open* ]] && continue; ./pdf-fullrewrite
-check "$f" out.pdf && good=$((good+1)) || echo "$f failed"; done; echo
"Passed: $good"
Passed: 20


# Incremental update of malformed document (object 0 missing) works.
# out.pdf is readable in Okular and Adobe Reader.
# pdf-fullrewrite verify function complains, that's expected
test$ ./pdf-fullrewrite -check -i '1_PDFsam_Untitled 2.pdf' out.pdf
XRef table: Unexpected number of entries (18+1 != 18)
Syntax Error: Invalid XRef entry  # XRef::getEntry(0) on 1_PDFsam_Untitled
2.pdf
Syntax Error: Invalid XRef entry  # XRef::getEntry(0) on out.pdf
XRef entry 0: generation number was expected to be 65535 (0 != 65535)
 # Error expected: Incremental update doesn't add object 0.
 # That's exactly how Adobe Reader behaves on incremental update of this file.
Verification failed


# Test full rewrite of malformed PDF
# out.pdf is completely fine, object 0 is added.
test$ ./pdf-fullrewrite -check '1_PDFsam_Untitled 2.pdf' out.pdf
Syntax Error: Invalid XRef entry  # XRef::getEntry(0) on 1_PDFsam_Untitled
2.pdf

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/poppler-bugs/attachments/20180628/826ddf3d/attachment.html>


More information about the Poppler-bugs mailing list