Creating password protect pdf files in batch

Discussion forum about all things Team Developer 5.x and 6.x
monchotgu
Honduras
Posts: 90
Joined: 24 Apr 2017, 02:55
Location: Honduras

Creating password protect pdf files in batch

Post by monchotgu » 07 Aug 2017, 02:54

I need to make a process that creates a password protected pdf file and sends by email to the employees. Can I do this with SalReportPrintToFile? Can anybody give any ideas on how to create such a file?

Thanks in advance!!

Jeff Luther
Site Admin
Site Admin
United States of America
Posts: 2385
Joined: 04 Mar 2017, 18:34
Location: Palm Springs, California

Re: Creating password protect pdf files in batch

Post by Jeff Luther » 07 Aug 2017, 15:16

I don't think that SalReportPrintToFile() and SalReportPrintToFileEx() support that directly. But, I thought I would add your question to google's search engine, so I did and see a number of links which might help you: https://www.google.com/search?q=passwor ... 8&oe=utf-8

It seems that it might be a 2-stop process:
1) Save the file out in PDF format with the SalReport function

2) Use a 3rd-party (or Adobe?) DLL, for example, that has functions to open a PDF, add a password that you pass to it, then save out the PDF file.

I looked in my TD code folder that I have kept for 20 years or more and see this note from Suren -- he was a Gupta support person many years ago -- that gives a hint on how to do this. You can also go to the old Gupta newsgroup here yourself and search for PDF related topics: viewforum.php?f=45

I'll add Suren's email reply from the newsgroup below on how to add a digital signature to a PDF file. Perhaps a similar method might work for you with adding a password. Note that this email is from 2004 and much has changed since then! In fact, the user who wrote is FR Bhote who is online here, I believe. In any event, here is what replied replied to FR then:

Subject: Re: Digitally Sign PDF documents
From: "Suren Behari"
Date: Mon, 1 Mar 2004 08:12:13 -0800
Newsgroups: forum.advanced.programming

Hi,

Two ways:
1) Use the extended JavaScript Object from Adobe Acrobat. The Form Field Object has a method called signatureSign that allows one to programmatically sign PDF documents. You can create the .js file externally and make it available in the same directory as the PDF, and then trap an event in the PDF to execute the js.

2) Use a third party product that is optimized to run in batch mode, like Appligent's SecureSign and Chilkat Software's S/MIME ActiveX Component.

Hope this helps,
Suren

"F R Bhote" wrote in message news:kfhlP7q%23DHA.2508@webserver...

Would appreciate if anyone could tell me a way to digitally sign PDF files directly without any user intervention. I need to sign about 1500 documents a day.
Jeff Luther @ PC Design
Palm Springs, California

Uwe van der Horst
Site Admin
Site Admin
Germany
Posts: 621
Joined: 05 Mar 2017, 14:21
Location: Wetter (Ruhr), Germany

Re: Creating password protect pdf files in batch

Post by Uwe van der Horst » 08 Aug 2017, 07:12

We are using the "debenu quick pdf library" for our Win32-applications. Easy implemetation, rich functionality, fair price and easy deployment to customers (you only have to register a dll). You can also download a trial version.
Best regards,
Uwe van der Horst
stp.one

Return to “General Discussion TD 5.x and 6.x”

Who is online

Users browsing this forum: [Ccbot] and 0 guests