PDFSharp not working properly after upgrading Dynamics 365 F&O to Platform Update 10.0.19 and higher

PDFSharp utility is a common tool to edit PDF documents in D365 used by many ISVs and partners, some customers noticed an issue after upgrading their system to 10.0.19 PU. For example when using the tool to merge PDF documents, the following error is thrown:

Cannot handle iref streams. The current implementation of PDFsharp cannot handle this PDF feature introduced with Acrobat 6.

This issue is only happening in Sandbox (T2 and up) and Production environments, Tier 1 environments is not affected.

Microsoft explained to us that this issue is related to recent upgrade on MS controlled instances (Sandbox and Production instance), the PDF file version changed from 1.3 to 1.7 because of the SSRS version upgraded from SSRS2016 to SSRS2019.

Following the Microsoft document: Exporting to a PDF File (Report Builder) – SQL Server Reporting Services (SSRS) | Microsoft Docs, “The PDF rendering extension also conforms to ISO 14289-1 (PDF/UA) standards for Accessible PDF.”

This Micorsoft document confirmed the PDF 1.7 version has to be used because of conformance reason: PDF Rendering Extension conformance to ISO 14289-1 – paginated reports – Power BI | Microsoft Docs

Resolution

To support PDF 1.7 you need to upgrade the PDFSharp utility by downloading the recent version from GitHub and replace the old one in your model:

https://github.com/empira/PDFsharp