-
Notifications
You must be signed in to change notification settings - Fork 137
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
PDF password removal #355
Comments
@MihaiSprinceana that's an interesting use case which should be possible with the next feature release. |
@MihaiSprinceana I've just released version 2.11.0 which adds support for custom actions. |
I was forced to work with encrypted pdfs as well. I managed to use pdf-lib in apps script to decrypt such pdfs and was loking for a way to 'trigger' it directly from gmail-processor. Custom actions sound promising. For reference, to use pdf-lib you need to take the @cantoo/pdf-lib fork because it allows decryption, get the minified file and copy paste it as another .gs file. Then remove exports at the end of it. Then
@ahochsteger |
@MikeDabrowski you can have a look at the types (ctx, args) =>{
...
const fileBase64 = Utilities.base64Encode(ctx.attachment.object.getBytes());
...
} If you need more help or have a working example let me know, maybe we can even integrate it into the core functionality. |
Great! I did not found a location where this file is stored. Am I just blind and it is in fact provided in the ctx somewhere? If it is not provided, I can use the location string from the config - is there any util that would transform it to folder? In the end I need a folder object to be able to call |
@MikeDabrowski you may use |
Thank you. Getting closer :) Btw, I could create a PR with pwd removal fn but it requires pdf-lib fork (quite a lengthy script) to be copied over OR converted to GAS library. I tried to peak at their code, hoping to extract only the pwd removal bit, but it requires much more time to invest. Unless npm install would work in this project and the lib would be included? |
Here is how you might decrypt PDFs. I had to use |
@MikeDabrowski nice to see that you're making progress :-). Concerning async in custom actions: Concerning the integration of pdf-lib: Writing custom functions with new dependencies might be too complicated. |
I'm using the below code to remove a password from a PDF file, but the integration with convertapi can do more.
Prerequisite: secret key from convertapi.
Note: is based on the Gmail2Drive project and it will require an account on convertapi website.
The text was updated successfully, but these errors were encountered: