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

Notifications

Announcements

Community site session details

Community site session details

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

How to Create a PDF/A-3 Document in Dynamics 365 for ZATCA Integration Phase 2

(1) ShareShare
ReportReport
Posted on by 19
Hello everyone,
I’m working on integrating with ZATCA (Zakat, Tax and Customs Authority) Phase 2 requirements, and part of this involves generating PDF/A-3 documents with embedded XML for e-invoicing compliance. I need to create PDF/A-3 files directly within Dynamics 365 Finance and Operations.
I've tried creating the PDF/A-3 externally in C# using a custom DLL and calling it from X++, but I'm running into challenges with D365 not recognizing the PDF library and facing compatibility issues.
 

My Questions:

  • Is there a way to generate PDF/A-3 documents directly in Dynamics 365 FO?
  • Has anyone successfully integrated ZATCA’s Phase 2 requirements for PDF/A-3 within D365, and if so, what approach did you use?
  • Are there any recommended third-party libraries or techniques that work smoothly with D365 for PDF/A-3 creation?
Any insights or guidance on handling PDF/A-3 compliance within Dynamics 365 would be greatly appreciated. Thank you!
 
Regards
Pratik Chakraborty
I have the same question (0)
  • André Arnaud de Calavon Profile Picture
    301,459 Super User 2025 Season 2 on at
    Hi Pratik,

    Have you checked for possible ISV solutions instead of trying to customize this yourself? There are some solutions listed on AppSource Business Apps – Microsoft AppSource. Also Flick Network seems to offer a solution.
  • ShahzaibAhmed52 Profile Picture
    148 on at
    Have you tried using itextsharp?

    here is the sample code for refrence.
     
    public byte[] ConvertToPDFA3Bytes(string srcPDF, string xmlPath, string xmlFileName)
    	{
    		iTextSharp.text.pdf.PdfReader reader = new iTextSharp.text.pdf.PdfReader(srcPDF);
    		using MemoryStream ms = new MemoryStream();
    		using (PdfStamper stamper = new PdfStamper(reader, ms))
    		{
    			PdfFileSpecification pfs = PdfFileSpecification.FileEmbedded(stamper.Writer, xmlPath, xmlFileName, null);
    			stamper.AddFileAttachment(xmlFileName.Replace(".xml", ""), pfs);
    		}
    		iText.Kernel.Pdf.PdfWriter myPDFWriter = new iText.Kernel.Pdf.PdfWriter(ms);
    		return ms.ToArray();
    	}
     
  • Pratik545 Profile Picture
    19 on at
    Hi @Ahmed
    Thnaks for the response, I see you have used both iTextSharp and iText 7 in your mentioned code.
    I have already written the code using iText 7 and is totally working in Console Application but to use it as a dll, we need to change the output type from console Application to Class Library. So, the challenges that I am facing recently is when I am creating the Dll and using it in f&o I am getting an exception in the line.
     
    PdfDocument pdfDocument = new PdfDocument(pdfReader);
     
    where pdfContent is the byte array of the existing pdf.
     
    Exception message : "Method not found: 'Void Microsoft.Extensions.Logging.LoggerExtensions.LogError(Microsoft.Extensions.Logging.ILogger, System.Exception, System.String, System.Object[])'."
     
     
     

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

News and Announcements

Season of Giving Solutions is Here!

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
Abhilash Warrier Profile Picture

Abhilash Warrier 732 Super User 2025 Season 2

#2
André Arnaud de Calavon Profile Picture

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

#3
Martin Dráb Profile Picture

Martin Dráb 289 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans