Four Js Development Tools Forum

Discussions by product => Reporting tools (GRW, GRE) => Topic started by: Abdulrahman A. on February 24, 2016, 07:17:07 am



Title: PDF Report Password
Post by: Abdulrahman A. on February 24, 2016, 07:17:07 am
To create PDF output I'm using the following reporting API functions:

  • CALL fgl_report_SelectDevice("PDF")
  • LET l_handler = fgl_report_commitCurrentSettings()

Is there any way to create PDF files contains a chosen password? Same as the shown photo, and by entering the correct password it will open the document.


Title: Re: PDF Report Password
Post by: Alex G. on February 24, 2016, 09:26:17 am
Hi,
a Goggle search turned up a tool called pdftk which seems to do the job. I tried the following:
$sudo aptitude install pdftk
$pdftk report.pdf output report_pw.128.pdf owner_pw robinson user_pw friday
$pdfinfo -upw friday report_pw.128.pdf
Title:         
Subject:       
Keywords:       
Author:         
Creator:       
Producer:       iText 2.1.5 (by lowagie.com)
CreationDate:   Thu Feb  4 15:33:40 2016
ModDate:        Thu Feb  4 15:33:40 2016
Tagged:         no
UserProperties: no
Suspects:       no
Form:           none
JavaScript:     no
Pages:          3
Encrypted:      yes (print:no copy:no change:no addNotes:no algorithm:RC4)
Page size:      595.28 x 841.89 pts (A4)
Page rot:       0
File size:      68573 bytes
Optimized:      no
PDF version:    1.4

Kind Regards,
Alex


Title: Re: PDF Report Password
Post by: Abdulrahman A. on June 28, 2018, 08:16:29 am
Thank you Alex,

I would appreciate if you could provide us with a full explanation with an example as this will help us.

Best Regards


Title: Re: PDF Report Password
Post by: Alex G. on June 28, 2018, 09:07:05 am
Hi,
>I would appreciate if you could provide us with a full explanation with an example as this will help us.
sure, with pleasure. First I would like to know if you were able to create a password protected PDF document using pdftk as I described in my previous post?
Best regards,

Alex