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

Added option to split PDF into multiple parts and merge into one PDF #841

Merged
merged 3 commits into from
Feb 24, 2024

Conversation

lm93129
Copy link
Contributor

@lm93129 lm93129 commented Feb 20, 2024

Description

Added the option to merge into one PDF in the function of splitting a PDF into multiple parts to facilitate the work of splitting a single-page PDF in the middle and then merging it.

Closes #(issue_number)

Checklist:

  • [*] I have read the Contribution Guidelines
  • [*] I have performed a self-review of my own code
  • [*] I have commented my code, particularly in hard-to-understand areas
  • [*] My changes generate no new warnings

Contributor License Agreement

By submitting this pull request, I acknowledge and agree that my contributions will be included in Stirling-PDF and that they can be relicensed in the future under the MPL 2.0 (Mozilla Public License Version 2.0) license.

(This does not change the general open-source nature of Stirling-PDF, simply moving from one license to another license)

@sbplat
Copy link
Member

sbplat commented Feb 20, 2024

What's the difference between this and the one from MergeController? Does it stitch together multiple pages into one (like 1x1+1x1=1x2)?

@lm93129
Copy link
Contributor Author

lm93129 commented Feb 20, 2024

For example, split a 10-page PDF horizontally and merge it into a 20-page PDF. (like 1x1+1x1=1x2+1x2)
Because for the convenience of printing, some PDFs will merge the original two pages of PDF into one page to facilitate cropping.

@sbplat
Copy link
Member

sbplat commented Feb 20, 2024

Would splitting it into sections and then merging it using the other feature be the same?

@lm93129
Copy link
Contributor Author

lm93129 commented Feb 20, 2024

Yes, it's the same
For example
example.pdf:
page1: AB
page2: CD

Split Horizontally and merge:
example_output.pdf:
page1: A
page2: B
page3: C
page4: D

If not merged:
example_output.zip:
pdf1,pdf2,pdf3,pdf4

@sbplat
Copy link
Member

sbplat commented Feb 20, 2024

What would be the use case for this if the merge pdf feature already exists? I might be misinterpreting what this feature does, but it seems to be the same feature to me.

@lm93129
Copy link
Contributor Author

lm93129 commented Feb 21, 2024

When using horizontal splitting, multiple PDF files will be generated. This function only adds an option to directly merge them into a single PDF file after splitting.

The scenario is: in order to facilitate cropping after printing, the PDF exported by some systems will merge the document that should have been two pages into one page. This way you can fold it in half and cut it directly. However, for other processing needs, these PDF files need to be split horizontally and merged into one file. This feature also appears in other PDF tools.

@sbplat
Copy link
Member

sbplat commented Feb 21, 2024

So this just simplifies a 2 step process into 1 step. I see what you mean now.

sbplat

This comment was marked as outdated.

@lm93129 lm93129 requested a review from sbplat February 21, 2024 07:19
@sbplat sbplat merged commit c8a3724 into Stirling-Tools:main Feb 24, 2024
3 checks passed
@sbplat
Copy link
Member

sbplat commented Feb 24, 2024

Thanks!

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

Successfully merging this pull request may close these issues.

None yet

3 participants