Skip to main content
Solved

Merge two PDFs before the report is generated?


Forum|alt.badge.img

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. 

Best answer by Yuriy Zaletskyy

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.

View original
Did this topic help you find an answer to your question?

4 replies

Yuriy Zaletskyy
Jr Varsity I
Forum|alt.badge.img+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.


Forum|alt.badge.img
  • Author
  • Jr Varsity III
  • 117 replies
  • January 21, 2023

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.


Yuriy Zaletskyy
Jr Varsity I
Forum|alt.badge.img+3
jwestermann17 wrote:

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


michaelnottoli29
Freshman I

Any updates to this topic?  This is a method that would be really useful for a few of our customers.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings