alexivkin / CUPS-PDF-to-PDF

CUPS-PDF with a patch to print text correctly
GNU General Public License v2.0
31 stars 12 forks source link

Fix invalid PDF due to extra line in spoolfile #5

Closed NtH0 closed 6 years ago

NtH0 commented 6 years ago

The removed fwrite was adding an unnecessary %PDF at the second line of the spoolfile. Some Acrobat Reader versions would refuse to open those files. The validation tool at https://www.pdf-online.com/osa/validate.aspx was also reporting errors.

Before this commit:

qwe@qwe:/var/spool/cups-pdf/SPOOL$ head -n 2 cups2pdf-8786
%PDF-1.5
%PDF%����

After:

qwe@qwe:/var/spool/cups-pdf/SPOOL$ head -n 2 cups2pdf-9002
%PDF-1.5
%����
alexivkin commented 6 years ago

Good find, thanks for fixing it.