Poppler test for sample-receipt.pdf

← Back to Poppler

Input: sample-receipt.pdf

sample-receipt.pdf first page preview

pdfinfo

pdfinfo "sample-receipt.pdf" >"sample-receipt--poppler-cpp--pdfinfo.txt"

pdftotext

pdftotext -layout -eol unix "sample-receipt.pdf" "sample-receipt--poppler-cpp--pdftotext.txt"

-raw: keep strings in content-stream order instead of reading order — useful comparison point against -layout's reconstructed reading order.

pdftotext -raw -eol unix "sample-receipt.pdf" "sample-receipt--poppler-cpp--pdftotext--raw.txt"

-i (ignore images) is required even with -stdout: pdftohtml still extracts embedded images to `<input-basename>-<page>_<n>.png` files written next to the INPUT PDF (not to our output path — images can't go to stdout) unless told not to. Confirmed the hard way: this wrote stray PNGs into pdf-inputs/ on PDFs with embedded images before -i was added.

pdftohtml -xml -i -stdout "sample-receipt.pdf" >"sample-receipt--poppler-cpp--pdftohtml.xml"