Stirling-PDF icon indicating copy to clipboard operation
Stirling-PDF copied to clipboard

[Feature Request]: detect if PDF has password before sending it to function, auto send it to remove-password first

Open Frooodle opened this issue 1 year ago • 8 comments

Feature Description

detect if PDF has password before sending it to function, auto send it to remove-password first

Why is this feature valuable?

No response

Suggested Implementation

No response

Additional Information

No response

No Duplicate of the Feature

  • [X] I have verified that there are no existing features requests similar to my request.

Frooodle avatar Sep 09 '24 14:09 Frooodle

@Frooodle is this check require for any specific module or all pdf input module

Gokulviper avatar Sep 11 '24 14:09 Gokulviper

All pdf inputs Ideally we can put this logic within the request handler (downloader.js) and have it check each request file if it's pdf then detect etc

Frooodle avatar Sep 11 '24 14:09 Frooodle

Hi @Frooodle I would like to work on it. Also can you give little more information on what exactly needs to be done.

dk-talks avatar Sep 12 '24 10:09 dk-talks

Within the downloader.js which handles all server side requests we should detect if the request file is PDF If it is, check if its encrypted with pdf.js or pdf-lib.js, If encrypted have a prompt pop up informing user password is encrypted and to work with this feature they need to decrypt it first, do they wish to enter pdf password to automatically decrypt first? On entering it will send PDF to remove-password endpoint (I don't think any JS library that does PDF dedyption exists so lets use server side), remove it, grab that blob and then use it in original method that user intended

Frooodle avatar Sep 12 '24 10:09 Frooodle

ok, understood. Please Assign it to me.

dk-talks avatar Sep 12 '24 11:09 dk-talks

@dk-talks any update on this?

Frooodle avatar Oct 28 '24 11:10 Frooodle

@dk-talks Due to lack of response, im assigning someone else to this

Frooodle avatar Nov 04 '24 11:11 Frooodle

https://github.com/Stirling-Tools/Stirling-PDF/compare/main...decrypt Work has been done on this previously, its missing translations, testing and possibly minor usecases Maybe a better prompt instead of a 'alert' as well?

Frooodle avatar Nov 04 '24 12:11 Frooodle

Code must

  1. Check if encrypted: a) Check if it needs password if so prompt and sent to remove b) Check if doesn't need password but is encrypted, if so auto decrypt

Frooodle avatar Dec 04 '24 09:12 Frooodle