web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Unanswered

Encrypt email pdf file with password

(0) ShareShare
ReportReport
Posted on by 5

Basically, I've to encrypt the pdf file before sending it through email via D365 Finance & Operation. I've written the code but it could not help to encrypt the pdf file.

pastedimage1675354753168v1.png

Could anyone know what is the issue in this why should that code not encrypt the file?

I have the same question (0)
  • Martin Dráb Profile Picture
    237,795 Most Valuable Professional on at

    If I understand it correctly, your question is about PdfSharp library and not F&O, therefore this isn't an ideal forum.

    Anyway, please tell us more about your problem. The description "it could not help to encrypt the pdf file" is pretty vague.

    Isn't the problem in the fact that you opened the document for only for reading?

  • Ahson Aslam Profile Picture
    5 on at

    Can we implement a password in PDF through x++?

    After receiving the PDF it should ask for a password.

  • Martin Dráb Profile Picture
    237,795 Most Valuable Professional on at

    Yes, PdfSharp library supports it and .NET Interop from X++ allows you to use it from X++, as you already know, because you're doing that above.

  • Ahson Aslam Profile Picture
    5 on at

    I import the  c# project and build the project after build the project it generates the DLL file after that I Place the DLL in the bin directory of the custom model and add the reference of PDF sharp Library and write the code as I mentioned above but it did not work to encrypt the PDF file .

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 660 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 549 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 307 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans