Wiki source code of PDF Transformation

Last modified by Eva Torken on 2023/12/07 14:56

Show last authors
1 {{container}}{{container layoutStyle="columns"}}(((
2 In most cases, you will transform XML messages to other XML messages, or you will transform JSON or EDI messages in another of these formats. However, sometimes you want to create a PDF document as output when transforming your XML data. Just as with the transformations for JSON and EDI, eMagiz also has support objects available that can be used to convert an XML message to a PDF in a similar manner as you are used to for JSON and EDI messages. In this microlearning, we will learn how to configure this solution within the platform.
3
4 Should you have any questions, please get in touch with [[academy@emagiz.com>>mailto:academy@emagiz.com]].
5
6 == 1. Prerequisites ==
7
8 * Expert knowledge of the eMagiz platform
9
10
11 == 2. Key concepts ==
12
13 This microlearning focuses on creating PDF documents with the help of the transformation functionality in eMagiz.
14
15 * Custom XSLT is needed
16 * Support Objects are needed to make the transformation work
17
18 == 3. PDF Transformation ==
19
20 In most cases, you will transform XML messages to other XML messages, or you will transform JSON or EDI messages in another of these formats. However, sometimes you want to create a PDF document as output when transforming your XML data. Just as with the transformations for JSON and EDI, eMagiz also has support objects available that can be used to convert an XML message to a PDF in a similar manner as you are used to for JSON and EDI messages. In this microlearning, we will learn how to configure this solution within the platform.
21
22 In contrast to when you transform from XML to JSON or EDI to XML, you cannot use the visual transformation tooling when transforming from your data model message (i.e., XML or JSON) to PDF. This is because the needed PDF structure cannot be visualized via the tooling. However, transforming from XML to PDF works similarly in Create as you are used to transforming from and to JSON and EDI.
23
24 So in effect, we need the following to achieve our goal of creating a PDF document via eMagiz:
25
26 * Custom XSLT is needed
27 * Support Objects are needed to make the transformation work
28
29 In this microlearning, we will focus on configuring the flow correctly and not on learning how to write a custom XSLT that will transform your message into a valid PDF structure. If you want more information on that, please check out [[XSL-FO>>https://w3schools.sinsixx.com/xslfo/default.asp.htm||target="blank"]].
30
31 When turning to the Create phase of eMagiz, we need to open the flow and enter "Start Editing" mode to add the support objects we need. For example, in the left panel of the flow designer, you can search for the term "FOP." This will yield the following results.
32
33 [[image:Main.Images.Microlearning.WebHome@expert-create-your-transformations-pdf-transformation-support-objects.png]]
34
35 To transform towards PDF, you must add both support objects to your flow. First, let us start with the "FOP XSL-FO result factory." After dragging it onto the canvas, you need to give it a name and save the support object by double clicking on it without making any changes. The same applies to the second component called "FOP XSL-FO result transformer."
36
37 After you have added both support objects to the flow, the last step is to link the support objects to your transformation component in the flow. This can be done on the advanced tab of the XSLT transformer component.
38
39 [[image:Main.Images.Microlearning.WebHome@expert-create-your-transformations-pdf-transformation-link-support-objects.png]]
40
41 {{warning}}Do not forget to implement a functional XSLT to get a desirable result{{/warning}}
42
43 == 4. Key takeaways ==
44
45 * So, in effect we need the following to achieve our goal of creating a PDF document via eMagiz:
46 ** Custom XSLT is needed
47 ** Support Objects are needed to make the transformation work
48 * Using the tooling to create a PDF document can get very complex, and in almost all cases, other alternatives are preferable to this solution
49
50 == 5. Suggested Additional Readings ==
51
52 If you are interested in this topic and want more information on it, please read the help text provided by eMagiz and read more information on the following links:
53
54 * [[XSL-FO>>https://w3schools.sinsixx.com/xslfo/default.asp.htm||target="blank"]]
55
56 )))((({{toc/}}))){{/container}}{{/container}}