tcr / scissors

PDF manipulation in Node.js! Split, join, crop, read, extract, boil, mash, stick them in a stew.
Apache License 2.0
285 stars 45 forks source link

Burst support? #4

Closed wmbutler closed 7 years ago

wmbutler commented 10 years ago

Do you support burst with pdftk which allows me to break a pdf into individual pages and store them separately?

tcr commented 10 years ago

Hi @wmbutler, I suppose you have the ability to use pdf.page(1), pdf.page(2), etc. and then output each as a stream. No built in command to do so seamlessly though. I think there needs to be a pdf.length() option as well...

wmbutler commented 10 years ago

I've run into some major issues with poppler when splitting pages (resolution of images is degraded). I'd love to hear of a creative solution with for scissors / pdftk. I need to split an n page document into n pages. And yes, I can iterate over a document but without knowing its length, I'm sort of stuck. Any thoughts? I'm at the point where I'm considering a shell script that will perform the operation and I can just have node call that script but it means file creation and cleanup and I'd really rather avoid that if possible. Ideally, I'd like to split the file and push it directly into a database page by page without the files every touching the filesystem.

cboulanger commented 7 years ago

@wmbutler, do you still need this? If so, please reopen the issue with a suggestion for an API method that would do what you need and which couldn't be realized in a few lines of user code (such as loop with scissor commands?). Thanks.