Password protect pdf

Stimulsoft Reports.JS discussion
Post Reply
terje.pedersen
Posts: 80
Joined: Thu Aug 18, 2016 7:29 am

Password protect pdf

Post by terje.pedersen »

settings = new Stimulsoft.Report.Export.StiPdfExportSettings();
settings.userAccessPrivileges = Stimulsoft.Report.Export.StiUserAccessPrivileges.All;
settings.keyLength = Stimulsoft.Report.Export.StiPdfEncryptionKeyLength.Bit128;
settings.passwordInputUser = password;
settings.passwordInputOwner = password;

Is there something more I need to do, the pdf is still created without password protection?
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Password protect pdf

Post by Alex K. »

Hello,

Unfortunately, in the JS version, at the current moment, this feature is not available.
There is task in our to-do list, but I cannot say when it will be available.

Thank you.
ervin.tanig
Posts: 1
Joined: Tue Mar 29, 2022 2:04 am

Re: Password protect pdf

Post by ervin.tanig »

terje.pedersen wrote: Fri Sep 15, 2017 10:59 am settings = new Stimulsoft.Report.Export.StiPdfExportSettings();
settings.userAccessPrivileges = Stimulsoft.Report.Export.StiUserAccessPrivileges.All;
settings.keyLength = Stimulsoft.Report.Export.StiPdfEncryptionKeyLength.Bit128;
settings.passwordInputUser = password;
settings.passwordInputOwner = password;

Is there something more I need to do, the pdf is still created without password protection?
Hello! Can I ask if this is applied to where ? I'm trying to do the password protect pdf
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Password protect pdf

Post by HighAley »

Hello,

These settings are working in our current build.
Do you get any issue with them?

Thank you.
monarch
Posts: 1
Joined: Fri Apr 08, 2022 12:52 pm

Re: Password protect pdf

Post by monarch »

ervin.tanig wrote: Tue Mar 29, 2022 2:06 am
Hello! Can I ask if this is applied to where ? I'm trying to do the password protect pdf
Using directive
using Stimulsoft.Report.Export;

Before export
StiPdfExportSettings settings = new StiPdfExportSettings();
settings = new StiPdfExportSettings();
settings.UserAccessPrivileges = Stimulsoft.Report.Export.StiUserAccessPrivileges.All;
settings.KeyLength = Stimulsoft.Report.Export.StiPdfEncryptionKeyLength.Bit128;
settings.PasswordInputUser = "pass";
settings.PasswordInputOwner = "pass";

Then
oreport.ExportDocument(StiExportFormat.Pdf, file, settings);

And report is exported with password
Lech Kulikowski
Posts: 6198
Joined: Tue Mar 20, 2018 5:34 am

Re: Password protect pdf

Post by Lech Kulikowski »

Hello,

Thank you for the provided information.
Post Reply