Closed dcanl closed 1 month ago
Huh. Never seen anything like this. I'm assuming pathOut
and fileOut
are where you want to write the output pdf to.
Just as a sanity check, does this code produce the same or different results:
from pathlib import Path # for python > 3.4
pdfList = [str(p) for p in sorted(Path(pathIn).glob("*.pdf"))]
pdfmerge(pdfList, str(Path(pathOut) / fileOut))
Thank you for your reply.
Result is the same...
Very weird. pdfmerge
just wraps pypdf
. Is it possible to see some more detail about how these PDFs are being generated?
Sadly no, files are generated by an AS/400, and hum... AS/400!! ðŸ«
Suprisingly, using pypdf directly doesn't seem to produce any blank page... I will use that for now.
Understood. Sorry we couldn't figure out where the blank pages were coming from.
Closing this issue for now. Will re-open if anyone else experiences the same thing.
Hello,
pdfmerge() function replaces some files with a blank page in the destination file for no reason. This behavior is totally random: same files in input can generate 1 to many blank pages in output file, or sometimes none.
I am currently trying with 4005 files in input, representing 4296 total pages. All input files are correct, the list contains all files path. Same problem appears with fewer files / pages.
Here is my code:
Did you ever encounter this problem? Is there a solution?