Page 1 of 2
How to set default PDF password
Posted: Mon Aug 22, 2016 4:46 pm
by Martin Hart Turner
I am using the WinForms version of StimulReports, and use the following code to show the rendered report on screen:
If the end user wants to export the report to PDF, I would like to be able to set the default password from my code. How might I go about such a task?
Re: How to set default PDF password
Posted: Tue Aug 23, 2016 9:16 am
by HighAley
Hello, Martin.
Could you specufy what password you need to set as default?
This should be the CertificatePassword of the StiPdfExportSettings?
Thank you.
Re: How to set default PDF password
Posted: Tue Aug 23, 2016 10:38 am
by Martin Hart Turner
Hi:
The password I wish to apply is the password used to open a PDF file. I don't wish to sign it with a certificate.
You see, the problem I have is I don't use the ExportDocument method to export of the report, I just show it in a modal window with the Show method. If the user decides to export the report to PDF via the modal windows' Save button, the user is asked to configure how he/she wishes to generate the PDF document. One of there settings is the password needed to open the exported PDF file. This is the password I wish to set programatically from my program, but I don't know if there is any option to do so!!
Re: How to set default PDF password
Posted: Wed Aug 24, 2016 4:46 pm
by HighAley
Hello, Martin.
Could you specify what password are are writing about?
Is it this password?

- password.png (23.3 KiB) Viewed 5831 times
Thank you.
Re: How to set default PDF password
Posted: Wed Aug 24, 2016 4:53 pm
by Martin Hart Turner
Yes, it is the 'User Password' specifically.
Thanks for your help.
Martin.
Re: How to set default PDF password
Posted: Fri Aug 26, 2016 7:33 am
by Alex K.
Hello,
Please try to set the PasswordInputUser and PasswordInputOwner in the StiPdfExportSettings.
Thank you.
Re: How to set default PDF password
Posted: Fri Aug 26, 2016 11:31 am
by Martin Hart Turner
Aleksey:
- 1.I don't use the ExportDocument method to export of the report, I just show it in a modal window with the report.Show method.
2.If the user decides to export the report to PDF via the modal windows' Save button, the user is asked to configure the export options.
3. This is what I am trying to set programmatically
As I don't use the ExportDocument method, and only use the report.Show method, I take it any possible setting would have to be a static property in a particular class (I have looked at Stimulsoft.Report.StiOptions.Export.Pdf, but the password is not one of the options available)
There may also be a way of assigning the StiPdfExportSettings to a report, but I can't find anything like that.
Finally, there may be a way to use Events from the report.Show window, but I can't see anything there either.
Regards,
Martin
Re: How to set default PDF password
Posted: Mon Aug 29, 2016 8:00 am
by HighAley
Hello, Martin.
We understand your issue.
We will try to add a static option and will let you know when it will be available.
Thank you
Re: How to set default PDF password
Posted: Tue Aug 30, 2016 6:38 am
by HighAley
Hello, Martin.
We have added next static options:
StiOptions.Export.Pdf.Security.DefaultUserPassword = userPassword;
StiOptions.Export.Pdf.Security.DefaultOwnerPassword = ownerPassword;
They will be available in our next prerelease build on Friday.
Thank you.
Re: How to set default PDF password
Posted: Tue Aug 30, 2016 6:43 am
by Martin Hart Turner
Wow, thanks!!!