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 option to merge multiple files into single PDF when bulk downloading #5002

Closed
wants to merge 12 commits into from

Conversation

czyzlukasz
Copy link

Proposed change

I'm using paperless-ngx for document sorting and periodic reports generation. Currently, the workflow requires from the user to select documents, download them as zipped collection, unpacking them and manually merging them in external file. I propose adding an option to automatically create single PDF when downloading multiple documents.

Changes in the front-end:

  • Following checkbox in bulk download component: image
  • Document IDs passed to BulkDownloadView are now passed in the same order as displayed to the user (useful when user wants the documents in a specific order)

Changes in the back-end:

  • BulkDownloadView: Selection between ZipFile and new MergedPdfFile as writer
  • Parsers: Added merge_pdfs method that uses already available ghostscript binary

Fixes # (issue)

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Other (please explain):

Checklist:

  • I have read & agree with the contributing guidelines.
  • If applicable, I have included testing coverage for new code in this PR, for backend and / or front-end changes.
  • If applicable, I have tested my code for new features & regressions on both mobile & desktop devices, using the latest version of major browsers.
  • If applicable, I have checked that all tests pass, see documentation.
  • I have run all pre-commit hooks, see documentation.
  • I have made corresponding changes to the documentation as needed.
  • I have checked my modifications for any breaking changes.

@czyzlukasz czyzlukasz requested review from a team as code owners December 16, 2023 18:03
@paperless-ngx-secretary paperless-ngx-secretary bot added backend frontend non-trivial Requires approval by several team members labels Dec 16, 2023
@paperless-ngx-secretary
Copy link

Hello @czyzlukasz,

thank you very much for submitting this PR to us!

This is what will happen next:

  1. My robotic colleagues will check your changes to see if they break anything. You can see the progress below.
  2. Once that is finished, human contributors from paperless-ngx review your changes. Since this is a non-trivial change, a review from at least two contributors is required.
  3. Please improve anything that comes up during the review until your pull request gets approved.
  4. Your pull request will be merged into the dev branch. Changes there will be tested further.
  5. Eventually, changes from you and other contributors will be merged into main and a new release will be made.

Please allow up to 7 days for an initial review. We're all very excited about new pull requests but we only do this as a hobby.
If any action will be required by you, please reply within a month.

@shamoon
Copy link
Member

shamoon commented Dec 16, 2023

Thank you for the PR.

I have to ask, respectfully, does anyone want this besides you? That’s why we usually use feature requests as the basis for new features. I understand the purpose but I wonder if the use case is a little narrow

@czyzlukasz
Copy link
Author

I agree that this feature may not be used by everyone, but I found that this topic was mentioned in some issues (#367, #502, paperless-ng 335, 426 and 789). I'm aware that document processing isn't something that paperless-ngx promises to deliver but I hope some users would find that useful.
They are other features that were mentioned in these issues, like rotate or document split. Let me know if that's something worth creating pull requests - I'd love to see these options in paperless-ngx ;)

@czyzlukasz czyzlukasz changed the title Add option to merge multiple file into single PDF when bulk downloading Add option to merge multiple files into single PDF when bulk downloading Dec 16, 2023
@shamoon
Copy link
Member

shamoon commented Dec 16, 2023

Yes I’m familiar with those ones but I think those requests are talking about the document in paperless, not just at download time? In other words, I’m not sure this would really satisfy those FRs

@stumpylog
Copy link
Member

I have to agree that this PR doesn't seem to fit the feature requests. From what I see, those are requesting to be able to split and merge within paperless, not during the download process. I would make a feature request and see if there is support for the feature. This PR can always be revisited.

@stumpylog stumpylog closed this Dec 18, 2023
Copy link
Contributor

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new discussion or issue for related concerns.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backend frontend non-trivial Requires approval by several team members
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants