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

Add the merging PDFs together example as a crate function #273

Open
DaniD3v opened this issue Apr 9, 2024 · 4 comments
Open

Add the merging PDFs together example as a crate function #273

DaniD3v opened this issue Apr 9, 2024 · 4 comments

Comments

@DaniD3v
Copy link

DaniD3v commented Apr 9, 2024

I think that merging two PDFs together is a very common use case. Would you mind adding that code to the library instead of just adding it as an example? I more or less copy-pasted it for now but that's not exactly a great solution.

I'm aware that this is a low-level library and a PDF merger doesn't exactly fit that category. If you're worried about that (or the unnecessary bloat it would add to the library) could you make it a new crate?

I know that I'm asking for a lot here but there's currently not really a crate that does that well. I even tried the more high level lopdf crates but they didn't work out for me.

@J-F-Liu
Copy link
Owner

J-F-Liu commented Apr 10, 2024

I'm aware that this is a low-level library and a PDF merger doesn't exactly fit that category. If you're worried about that (or the unnecessary bloat it would add to the library) could you make it a new crate?

I don't have this worry, PR is welcome

@williamdes
Copy link
Collaborator

@Heinenen How do you view this request?
It would definitely be a great feature to replace existing pdf mergers at work for example.

If some features are not implemented here, will this break while merging?

@Heinenen
Copy link
Collaborator

Sounds good.

I think this issue only aims to have the second example in the README "Merge PDF documents" wrapped in some library function.
This would not add any functionality to lopdf, only convenience.

I can't speak to the current quality of the merging.

@einoj
Copy link
Contributor

einoj commented Oct 8, 2024

Not sure if this resolves the issue, but I added merge (by copying the code from example/merge.rs) functionality to the pdfutil so it can merge pdfs by running pdfutil --merge A.pdf B.pdf --output C.pdf.
I did this because I was unhappy with how slow pdftk was when merging pdfs. It used over 1 second while pdfutil uses 14ms when merging the same pdfs!

#340

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

No branches or pull requests

5 participants