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

Split pages of a document into individual PDF files #69

Closed
sikri-eic opened this issue Jun 1, 2022 · 4 comments
Closed

Split pages of a document into individual PDF files #69

sikri-eic opened this issue Jun 1, 2022 · 4 comments

Comments

@sikri-eic
Copy link

sikri-eic commented Jun 1, 2022

Is your feature request related to a problem? Please describe.
I wonder if it would be possible to implement a method where we split a PDF file such that each page in the document becomes an individual file.

Describe the solution you'd like
It looks like we have the possibility to split PDF into two by providing a page range, but instead of doing that in a loop where I get a single page on every step and create a PDF out of that I think it would be great if the new method would simply return a list of pages that can later be saved as separate files.

Describe alternatives you've considered
As stated above, the alternative seems to be looping over the document using the existing Split methods.

Additional context
Maybe there is a better approach that solves this in a more elegant way?

@Modest-as
Copy link
Member

I do not think I follow, on split you already get a fully qualified PDF file based on a range you provide. Returning some abstraction on top of the document that can then potentially be converted to file does not add any real performance benefits and complicates the façade.

@sikri-eic
Copy link
Author

If I didn't misunderstand the API, the split function only splits the document into two. I was looking for something that can be used to split a 10 page document into 10 documents. Of course, the existing functionality can be used in a loop to achieve that, but I suspect that it won't be as performant as doing it in the library.

@Modest-as
Copy link
Member

Hey, it would be still a loop in the library, because that is the API PDFium exposes so there would be no performance benefit there.

@sikri-eic
Copy link
Author

Thanks for looking into this.

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

2 participants