How to Merge PDF Files in Microsoft Dynamics 365 Business Central
In today’s fast paced world of business, companies are always looking for ways to optimize processes as they interact with customers, supply chain, warehouse systems, and more. Recently, our team had a request to merge pdf files within Microsoft Dynamics 365 Business Central SaaS, but our customer couldn’t use external Dynamic Link Library (DLL) files or dotnet to merge PDF files, since those file formats are not supported in the SaaS environment.
This customer needed to send sales documents with Terms and Conditions as well as Warranty terms in one pdf document to their customers. The customer sends large volumes of sales orders and some invoices and were worried that if this information wasn’t sent together that customers would not view them.
Initially, we thought the perfect solution was already available in Business Central via the Document Sending Profiles and the “Combine” option. However, I evaluated this feature and attempted to write logic that would attach the Terms and Conditions pdf to the Sales Order report.
Unfortunately, this didn’t work. The out-of-the-box Business Central PDF feature is simply setting a document number filter and running the sales report that creates one pdf with all orders via the filter. It doesn’t string PDFs of each document.
A Logical Solution via the Control Add-in Library
And there are a few “gotchas” that I just want to point out up front in case you try this on your own:
- The Print button does not display the report on the monitor as it is a PDF and is therefore downloaded to the download folder. I put a message in for the user, ‘Please refer to your download folder to get the document’
- Calling the download logic from a custom codeunit does not work. You must have the control add-in logic on the Page with the Print w/TnC action button as is supplied in the example from Gonzales Rios Ley.
Learn More About ArcherPoint’s Support Options
While Rios Ley offers basic logic for this particular challenge, ArcherPoint can deliver on-going support for more complicated requirements. We serve support clients 24 x 7 x 365 with highly responsive, experienced Tier 2 and Tier 3 team members who are ArcherPoint employees — not a distant outsourced entity. If you have any questions about customer support options, please contact us.