Skip to content

Pdf merger - #2

Open
burkkyy wants to merge 7 commits into
mainfrom
pdf-merger
Open

Pdf merger#2
burkkyy wants to merge 7 commits into
mainfrom
pdf-merger

Conversation

@burkkyy

@burkkyy burkkyy commented Mar 28, 2025

Copy link
Copy Markdown
Member

Context

Attachments in an archive item need to all be converted, merged and then signed into a single pdf ready for file store upload

Implementation

  • simplified pdf signer to take in a buffer and return a buffer
  • Archiver attachments are queue for pdf conversion via upload to a cache
  • In pdf converter job once all attachments are converted to a pdf, the archive is queued for merge
  • In archive item upload job all pdfs in archive item are merged into one pdf, signed, then uploaded (UPLOAD TODO)

Testing Instructions

  1. Boot the app via dev up
  2. Log in to the app at http://localhost:8080
  3. Go to create archive item page at http://localhost:8080/archive-items/new
  4. Add an arbitrary number of files (not a binary) to the attachment, then save the archive item
  5. Wait for PDF converter job to run and finish
  6. Check redis cache for PENDING_FILESTORE_UPLOAD_ARCHIVE_ITEM_ID_
  7. Wait for archive item upload job to run and finish

@burkkyy burkkyy self-assigned this Mar 28, 2025
@burkkyy burkkyy added the enhancement New feature or request label Mar 28, 2025
@burkkyy
burkkyy marked this pull request as ready for review March 29, 2025 01:08

// if (uploadResp.errorCode) {
// throw Error("File upload error")
// }

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where on the file store should the merged(and signed) pdf go?

// throw Error("File upload error")
// }

// update file record?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the file record need to be updated? Or does the filestore only care about the merged pdf?

Comment thread archiver/src/jobs/pdf-converter-job.ts
Comment thread archiver/src/services/merge-pdfs-service.ts Outdated
Comment thread archiver/src/jobs/pdf-converter-job.ts
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

Successfully merging this pull request may close these issues.

2 participants