Cannot print PDF when Security.Encrypt is set to True with V12

Posted by: David.Cyr on 26 October 2020, 1:03 am EST

    • Post Options:
    • Link

    Posted 26 October 2020, 1:03 am EST

    With many versions of ActiveReports we were able to generate a PDF report and print in Adobe with the following code:

    
    Dim pdfExp As New PdfExport
    pdfExp.ImageQuality = ImageQuality.Highest
    pdfExp.ImageResolution = 3600
    pdfExp.Security.Encrypt = True
    pdfExp.Security.Permissions = PdfPermissions.AllowPrint
    pdfExp.Security.OwnerPassword = "******"
    pdfExp.Export(doc, OutPutFileName)
    
    

    When we upgraded from version 9 to version 12 of ActiveReports. The printing option in Adobe was disabled.

    I removed “pdfExp.Security.Encrypt = True” and that fixed the problem. Is this a bug? Is it OK if the Encrypt option is removed?

    Thank you,

    David

  • Posted 26 October 2020, 5:09 am EST

    Hello,

    Can you please try after setting the UserPassword as follow:

    pdfExport.Security.UserPassword = “*******”;

    Encrypt property is used to ecrypt the document. If you don’t want to restrict permission on the Exported PDF then you can remove it.

    Thanks,

    Mohit

  • Posted 3 November 2020, 6:26 am EST

    Hello Mohit,

    Your solution will not work because I do not want the user to have a password to view the PDF, I want a password for modifying the PDF but still want them to be able to print. So if I write the code below the printing option is disable in Adobe. This was working in versions earlier than ActiveReports 12.

    
    pdfExp.Security.Encrypt = True
    pdfExp.Security.Permissions = PdfPermissions.AllowPrint
    
    ```[img]https://gccontent.blob.core.windows.net/forum-uploads/file-ad1a5a6e-5b63-4b1e-9cf8-06eeecf580cc.jpg[/img]
    
    Thanks,
    David
  • Posted 4 November 2020, 5:14 am EST - Updated 30 September 2022, 7:54 am EST

    Hi David,

    I tried the same code with ActiveReports 12 SP3 and the generated pdf has the Printing option set to Allowed.

    Can you please specify the version of ActiveReports 12 you’re using. If you’re not using ActiveReports 12 SP3, I would suggest you to download it from the link below:

    https://global-cdn.grapecity.com/downloads/activereports/ActiveReports-v12.3.17127.0.msi

  • Posted 4 November 2020, 5:14 am EST - Updated 30 September 2022, 7:54 am EST

    Hi David,

    I tried the same code with ActiveReports 12 SP3 and the generated pdf has the Printing option set to Allowed.

    Can you please specify the version of ActiveReports 12 you’re using. If you’re not using ActiveReports 12 SP3, I would suggest you to download it from the link below:

    https://global-cdn.grapecity.com/downloads/activereports/ActiveReports-v12.3.17127.0.msi

  • Posted 12 November 2020, 6:53 am EST

    I’m using version 12.2.13986.0 I will try using the version you mentioned. Thank you for your help.

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels