Expand my Community achievements bar.

July 31st AEM Gems Webinar: Elevate your AEM development to master the integration of private GitHub repositories within AEM Cloud Manager.

HOW TO MERGE TWO PAGES INTO ONE using DDX?

Avatar

Former Community Member
Hello,



HOW TO MERGE TWO PAGES INTO ONE using DDX?

===============================



Could any one of you expert can help to solve the below issue?



I need to merge/assemble two or more PDFs into one. As a beginner i understood the Assembler Service is a solution for this problem. But, i end up no answer for the following situation.



We have three different PDFs.

PDF1 - Header message

PDF2 - Body Message 1

PDF3 - Body Message 2



PDF1 PDF2 PDF3

------------------- ------------------- -------------------

| | | | | |

| | | body | | body |

| header | | message1 | | message2 |

| (dynamic) | | | | |

| | | | | |

| | | | | |

| | | | | |

------------------- ------------------- -------------------



Based on some business constraint, i have to merge "Header" page with "Body Message1" (or) merge "Header" page with "Body Message 2"



------------------- -------------------

| | | |

| header | | header |

------------------- -------------------

| | or | |

| | | |

| body | | body |

| message1 | | message2 |

------------------- -------------------



Limitations:

- Body message cannot have header message within it, because the same body message will be used with another header.



Thanks

Siva
1 Reply

Avatar

Former Community Member
You can either use <PageOverlay> to overlay the Header PDF page onto the PDF with the Body, or you could turn the Header PDF page into a <Header> DDX element. It depends on the page size of the Header PDF.



Please be aware that if you use <Header>, the default margins for positioning the header are 1/2 inch all around. You can set this to 0 or whatever you want using the <PageMargins> element.



An example of using PageOverlay:



<?xml version="1.0" encoding="UTF-8"?>

<DDX xmlns="http://ns.adobe.com/DDX/1.0/" >



<PDF result="result1">

<PDF source="PDF2"/>

<PageOverlay>

<PDF source="PDF1"/>

</PageOverlay>

</PDF>



<PDF result="result2">

<PDF source="PDF3"/>

<PageOverlay>

<PDF source="PDF1"/>

</PageOverlay>

</PDF>



</DDX>