Resulting PDFs have errors according to mutool, pdfcpu and other tools
PDFs generated by pagedjs-cli (0.1.6 on linux), even for the simplest files, have errors according to MuPDF (mutool), pdfcpu and other tools.
I tested with the simple file:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>A test</title>
</head>
<body>
<p>Hello world!</p>
</body>
</html>
According to MuPDF's mutool (mutool info output.pdf
) the result has these errors:
error: expected trailer marker
warning: trying to repair broken xref
warning: repairing PDF document
llpp, which is based on MuPDF, reports these errors as well as "PDF stream Length incorrect", which is how I know about this problem, since it appears whenever I open a file created with pagedjs-cli.
Additionally, pdfcpu validate output.pdf
gives the following:
validating(mode=relaxed) output.pdf ...
validation error (obj#:1): pdfcpu: validateDateObject: <2022-02-21T18:14:48.338Z> invalid date
JHOVE reports a similar error.
None of these errors are likely to cause a PDF not to be readable, but they are annoying.
Additionally, I'm curious why a PDF created by pagedjs-cli tends to be at least twice as big, sometimes three times as big, in filesize, as the corresponding PDF created by weasyprint. (Running it through ghostscript's ps2pdf
afterwards shrinks it right down, at least.)