wubzz / pdf-merge

Merge multiple PDF Files into a single PDF document
127 stars 32 forks source link

More than 15 pdfs causes an invalid file #8

Closed happilymarrieddad closed 7 years ago

happilymarrieddad commented 8 years ago

Everytime I try to generate a pdf from more than 15 other pdfs, it returns an invalid pdf file that none of the readers I have can parse. It's almost like there is a memory issue or something.

wubzz commented 8 years ago

@happilymarrieddad Going to need some more information on this, such as PDF filenames (length) and filesizes, what your node process CPU/Memory usage is.

happilymarrieddad commented 8 years ago

oh sorry man,

selection_130

"/var/www/fusion/public/images/temp/printlabel-116251044535424852258676.pdf" "/var/www/fusion/public/images/temp/printlabel-116252042333645460811575.pdf" "/var/www/fusion/public/images/temp/printlabel-11625305474470039689505.pdf" "/var/www/fusion/public/images/temp/printlabel-11625408987722079016849.pdf" "/var/www/fusion/public/images/temp/printlabel-11625505457466533471083.pdf" "/var/www/fusion/public/images/temp/printlabel-11625605714969587011638.pdf" "/var/www/fusion/public/images/temp/printlabel-116257021536666893112044.pdf" "/var/www/fusion/public/images/temp/printlabel-1162580028078796213059976.pdf" "/var/www/fusion/public/images/temp/printlabel-1162590690549601558802.pdf" "/var/www/fusion/public/images/temp/printlabel-11626006436126211579158.pdf" "/var/www/fusion/public/images/temp/printlabel-11626108978347740286463.pdf" "/var/www/fusion/public/images/temp/printlabel-116262010192026265854248.pdf" "/var/www/fusion/public/images/temp/printmultiplelabels-05170397100087565.pdf"

more like that... pdf-merge doesn't give me any errors but here is what easy-pdf-merge gives me.

selection_131

I understand you're not using java but I can't seem to get an error with your package. It just returns an invalid pdf. I open it in any viewer and it fails. Thanks!

happilymarrieddad commented 8 years ago

I can send you the pdf's we're trying to merge.. it's not sensitive material.

happilymarrieddad commented 8 years ago

selection_132

prescottprue commented 8 years ago

Any movement on this? I am not receiving any errors either.

wubzz commented 8 years ago

@happilymarrieddad @prescottprue Generally this module will only throw an error if whatever the thirdparty module PDFtk spits back out is stderr.. I tested a merge of 50 PDF documents just now and it worked completely fine, all with very long names like you suggested.

My guess is this has something to do with the actual PDF files. Password protected? Encrypted? Corrupt? Hard to guess.. If you don't mind sharing them somewhere, I'll have a closer look.

My first through maybe it was due to duplicate names, since you listed a couple of duplicates, but doesn't look like that's the case either (tested, works)

happilymarrieddad commented 8 years ago

hmm I'll upload some example pdfs in probably a day. Sorry I'm really busy at work and can't get to this today.