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

✨ basic PDF support #158

Merged
merged 8 commits into from
Sep 19, 2023
Merged

✨ basic PDF support #158

merged 8 commits into from
Sep 19, 2023

Conversation

aaronleopold
Copy link
Collaborator

Resolves #35

With these changes, PDFs are mostly supported:

  • PDFs can be scanned, and metadata (if any) can be extracted
  • PDFs can have generated thumbnails
  • PDF pages can be streamed
  • PDF files can be sent to the client for download and/or viewed in a native PDF viewer

This pulls in two additional libraries in the core:

  1. pdf
  2. pdfium-render

The pdfium-render allows the core to properly process PDF pages as images. However it should be noted the concerns brought up from #156 (comment). I think, considering how few options there are, this will just have to be tried and tested over time.

There are some areas that need improvements, but I will follow up with them at another time:

  • PDF page streaming will only output PNG images for the time being. This is hard coded, but will be replaced with some sort of option to configure it
  • I added basic PDF-to-ZIP conversion support in the core, but am not hooking it up with UI elements yet. I'll leave that for the dedicated ticket for that feature.

@aaronleopold
Copy link
Collaborator Author

aaronleopold commented Sep 16, 2023

A little update after some experimentation with the Docker builds locally. The added dependencies (the PDF crate and then the PDFium binary) and the additional PDFium stage to the docker build seem to have added about 40MB to the uncompressed size, totaling about 160MB now 😭 This isn't awful, but adds up when factored together with the switch from Alpine to Debian so I'd like to try and maintain and not add too much more. I imagine there are some fancier things to be done with the layers that can reduce this increase, but it's fine for now. Otherwise, everything functions great!

@aaronleopold aaronleopold merged commit 5589803 into develop Sep 19, 2023
7 checks passed
@aaronleopold aaronleopold deleted the al/pdf branch September 19, 2023 01:53
@aaronleopold aaronleopold mentioned this pull request Sep 19, 2023
8 tasks
aaronleopold added a commit that referenced this pull request Sep 23, 2023
* New translations en.json (Portuguese)

* 📝 Update README and CONTRIBUTING

* 🐛 fix autoclosing drawer (#157)

* ✨ basic PDF support (#158)

* start barebones PDF support, update some docs

* PDF rendering and streaming support

* support PDF-to-ZIP conversions in core (#156)

* remove duplicate logic

* download pdfium in Dockerfile

* oops

* oopsies

* 🐛 Fix entrypoint.sh adduser and addgroup commands (#160)

* New translations en.json (German)

* New translations en.json (German)

* New translations en.json (Dutch)

* 🎨 support regenerate thumbnails from UI and improve mobile friendliness (#161)

* New translations en.json (Romanian)

* New translations en.json (French)

* New translations en.json (Spanish)

* New translations en.json (Afrikaans)

* New translations en.json (Arabic)

* New translations en.json (Catalan)

* New translations en.json (Czech)

* New translations en.json (Danish)

* New translations en.json (German)

* New translations en.json (Greek)

* New translations en.json (Finnish)

* New translations en.json (Hebrew)

* New translations en.json (Hungarian)

* New translations en.json (Italian)

* New translations en.json (Japanese)

* New translations en.json (Korean)

* New translations en.json (Dutch)

* New translations en.json (Norwegian)

* New translations en.json (Polish)

* New translations en.json (Russian)

* New translations en.json (Serbian (Cyrillic))

* New translations en.json (Swedish)

* New translations en.json (Turkish)

* New translations en.json (Ukrainian)

* New translations en.json (Chinese Simplified)

* New translations en.json (English)

* New translations en.json (Vietnamese)

* New translations en.json (Portuguese, Brazilian)

* New translations en.json (Portuguese)

* New translations en.json (French)

* make all available languages selectable
@aaronleopold aaronleopold mentioned this pull request Feb 18, 2024
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.

1 participant