pdfcpu: writeStream: missing eol before keyword endstream

I’m currently using the pdfcpu golang api (v0.3.6) and came across an error that I was also able to reproduce using the latest release (v0.3.8), both from golang api as well as using the standalone pdfcpu executable on win64.

When extracting a single page out of a PDF document and opening the resulting file in PDF XChange Editor (Free version), it complains that there would be an error in the XREF table. It still displays the PDF. Opening the same file in Acrobat Reader or xpdf does not yield any errors, so I do not know whether this might only be a small issue or perhaps even wrong alert.

I tested this with different PDF documents from different sources. Also checked that the original documents from which I extracted the pages did not show any error when opening in PDF XChange Editor.

The command that I used to extract was nothing special: pdfcpu.exe extract -m page -p 1 input.pdf outputDir. Please find attached a sample input and output file from testing.

input.pdf input_page_1.pdf

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 16

Commits related to this issue

Most upvoted comments

Thanks! I can confirm that the validation error in PDF XChange is now gone. Great work!