How do i merge 2 AFP's created from Apache FOP

89 Views Asked by At

How do i merge large number of separate AFP files created using apache FOP into a single AFP file? Any suggestions for tools is also welcome.

1

There are 1 best solutions below

0
Cunning as a fox On

Don't know if you found or created a solution to your question but you're probably aware by now that this is not an insignificant task. Apart from being able to strip out the resources you also need to consider how they are called in the document. To illustrate this suppose there are 2 .AFP files with 2 sets of resources. Looking at just the font resources one file defines fonts (Character Sets) FONT100 and FONT200. File 2 defines FONT300 and FONT400. Following the Begin Document field (BDT) File 1 defines Font100 as map coded font(MCF) 1 and FONT200 as MCF 2. File 2 defines FONT300 as MCF 1 and FONT400 as MCF 2. If you are to merge these 2 files not only do you need to extract the resources but also consider how you build the MCF record(s) and how the presentation text (PTX) records are changed to reference the fonts in the new MCF record. Whilst this applies to fonts it may also apply to any other resources eg PSEG, OVL etc. If you need to read up on AFP, Structured Fields and Triplets: https://www.afpconsortium.org/publications.html Start with MO:DCA Reference (Mixed Object Document Content Architecture Reference) and PTOCA Reference (Presentation Text Object Content Architecture Reference)