fsinf / pdf-page-stripper

Strips useless pages from TU Wien PDFs
https://fsinf.github.io/pdf-page-stripper/
The Unlicense
11 stars 1 forks source link

ZIP download feature, new UI, Drag'n Drop #1

Closed Jozott00 closed 3 years ago

Jozott00 commented 3 years ago

Overview

What are the added features?

ZIP Download

After the pdf stripping process, the user is now able to download all (stripped) files packed in one zip file.

Drag and Drop

Users have the possibility to drag and drop pdf-files directly into the upload area. Manually selecting files from directory is still possible by clicking "Drag'n drop or select PDF-files here".

New UI with progressbar

The UI is now a simple white - blue (shading) design, with card elements. After selecting files, a progressbar is shown which indicates the progress of the pdf stripping. The download area holds a button on the top to download all files as zip (and also shows the size of the generated zip file), followed by the list of all given pdf files. Each file can be downloaded individual. At the bottom is a "Strip again" button.

Solution Notes

I did not change the way of stripping the pdfs, but I added some types and two comments with one link to adobe's page label documentation. The implementation of the zipping is mainly implemented as a function inside the pdfLib object (same as the stripPdf()). I added some new reactive data references and two new Components (Downloadarea, Drag n Drop), which are written in data-methods-style (without setup()).These components have no core computational functionalities, but are responsible for collecting and providing files to/from the user.

Testing

I did not test the app excessively, but since the core functions did not change, it should be fine. I tested the app on Chromium 88.0.4324.150, Firefox 85.0.2, Safari 14.0.3.

One Bug

Unfortunately I found one bug: When a User selects the exact same files a second time, the app does not recognize that new files were selected. I think this is because the "onChange()" event doesn't trigger, since the files didn't really changed. Since users wouldn't strip the same file twice and even if they do so, they could just refresh the page, I did not fixed this bug yet.

Note

Colorized the favicon and made it round.


Screen-Recording-2021-02-12-at-12 18 01

It's actually much faster, the .gif makes it so slow.

stefnotch commented 3 years ago

This looks absolutely amazing! Thank you very much for the awesome PR