Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

could this be called from the command line? #72

Closed
Kreijstal opened this issue Jan 21, 2022 · 11 comments
Closed

could this be called from the command line? #72

Kreijstal opened this issue Jan 21, 2022 · 11 comments
Labels
enhancement New feature or request

Comments

@Kreijstal
Copy link

it'd be nice, because it only depends on node

@mojoaxel
Copy link
Collaborator

@Kreijstal Sorry i've overlook this! This is a very nice idea!

Do you have any idea how a interface could look? Should it only be possible to merg two documents or multibles at the same time? What about page number?

Let's discuss this idea here any further!

@mojoaxel mojoaxel added the enhancement New feature or request label Mar 30, 2022
@mojoaxel
Copy link
Collaborator

Here is a proposal:

pdf-merger-js --out=merged.pdf input1.pdf[1,2] input2.pdf input3.pdf[3-6]

So this would merge
page 1 and 2 of input1.pdf
with input2.pdf
and with pages 3 to 6 of input3.pdf
and save everything to merged.pdf

@mojoaxel
Copy link
Collaborator

For very basic merging you could use pdf-merger-cli.

@Kreijstal
Copy link
Author

For very basic merging you could use pdf-merger-cli.

could we merge these with the original? very cool by the way

@mojoaxel
Copy link
Collaborator

Here is another proposal I like. This would also keep urls valid:

pdf-merger-js --out=merged.pdf input1.pdf#1,2 input2.pdf input3.pdf#3-6

@sabine33
Copy link

sabine33 commented Feb 6, 2023

Please look at this package, It does work exactly as @mojoaxel wanted.

@sabine33
Copy link

sabine33 commented Feb 6, 2023

Pleas have a look at it.

@mojoaxel
Copy link
Collaborator

Here is a overview about existing solutions

merge-the-pdfs

$ merge-the-pdfs --folder ~/Downloads/pdfs --output filename.pdf --files abc.pdf#1,2 apple.pdf#3,4
$ merge-the-pdfs --output filename.pdf --files abc.pdf#1,2 apple.pdf#3,4

pdf-merger-cli

$ npx pdf-merger-cli out.pdf input1.pdf input2.pdf
$ npx pdf-merger-cli out.pdf input*.pdf

merge-pdf-cli

$ merge-pdf inputfile-1.pdf inputfile-2.pdf
$ Successfully merged pdfs.  Output : merged-file.pdf

@mojoaxel
Copy link
Collaborator

Looking at the existing solutions I would propose the following cli:

Simple inputs

pdf-merger-js --output merged.pdf input1.pdf input2.pdf

Select pages

pdf-merger-js --output merged.pdf input1.pdf#1-3 input2.pdf#3,4,6

Glob inputs

pdf-merger-js --output merged.pdf ./**/input*.pdf

URL inputs

pdf-merger-js --output merged.pdf https://example.org/input1.pdf#1-2 https://example.org/input2.pdf#3-6

@mojoaxel
Copy link
Collaborator

This has been implemented with #130 🎉

@mojoaxel
Copy link
Collaborator

The command-line-interface is available since v5.1.1 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants