Solved

Merge two PDFs before the report is generated?

  • 19 January 2023
  • 3 replies
  • 134 views

Userlevel 3
Badge

Hello Hello,

i’d like to know if it would be possible to grab into the generation process of the reports and under- or overlay another set of pdfs to it? Overlaying two pdfs above each other is not the hard part i’d say but is there a way we can do this while the report preview generates? We would like to use this method to include high-res background images to the reports (watermarks or whatever - svgs basically), since the report designer does not support svg files and pngs are pixelated at printing or at zooming in. 

icon

Best answer by Yuriy Zaletskyy 21 January 2023, 10:28

View original

3 replies

Userlevel 5
Badge +3

In Acumatica, it is possible to modify the generation process of reports to include additional PDFs as a background or overlay on top of the main report. This can be done by creating a custom report implementation that inherits from the existing report implementation and modifies the generation process to include the additional PDFs.

One way to accomplish this is to use the Acumatica report designer to create the main report, then use a third-party library, such as iTextSharp, to programmatically merge the main report with the additional PDFs before it is displayed to the user.

You can do this by creating a new custom report implementation, which will inherit from the existing report implementation. In this custom implementation, you can override the methods that generate the report and add logic to merge the main report with the additional PDFs before it is displayed to the user.

You can also use the PdfPageEventHelper class of iTextSharp, to add the background image in the OnEndPage event.

Another way is to use the Acumatica's PrintJobEventArgs, that can be used to modify the rendered pdf report, before it is sent to the printer or to the user.

Keep in mind that the implementation of this customization may vary depending on the specific requirements and the version of Acumatica you are using.

In summary, it is possible to modify the generation process of reports in Acumatica to include additional PDFs as a background or overlay on top of the main report by creating a custom report implementation, that inherits from the existing report implementation and programmatically merge the main report with the additional PDFs before it is displayed to the user, or by using the PdfPageEventHelper class of iTextSharp or PrintJobEventArgs event of Acumatica to add the background image.

Userlevel 3
Badge

Hej @Yuriy Zaletskyy 

Thank you very much for your detailed answer.
Now i’ll need to find out how to actually do this and how to create it in such a way that the customer - or we as company - are still able to change stuff like backgrounds with ease without hardcoding them. Will be a long process for sure.

Userlevel 5
Badge +3

Hej @Yuriy Zaletskyy 

Thank you very much for your detailed answer.
Now i’ll need to find out how to actually do this and how to create it in such a way that the customer - or we as company - are still able to change stuff like backgrounds with ease without hardcoding them. Will be a long process for sure.

understand, we’ve did something similar in scope of 2 days to 3 weeks, depending from scope of changes. But overall path is as described

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved