Wiki source code of PDF Transformation
Last modified by Carlijn Kokkeler on 2024/09/03 12:26
Show last authors
author | version | line-number | content |
---|---|---|---|
1 | {{container}}{{container layoutStyle="columns"}}((( | ||
2 | In this microlearning, we’ll dive into the process of creating PDF documents using eMagiz’s transformation functionality. Unlike standard data transformations between formats like XML, JSON, and EDI, generating a PDF from XML requires a different approach. We’ll cover how to set up your transformation flow with custom XSLT and essential support objects. While visual transformation tools aren’t available for PDF, we’ll guide you through the necessary steps to configure your flow effectively. Let’s explore how to achieve your PDF generation goals with eMagiz. | ||
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 | * [[eMagiz Store (Menu)>>doc:Main.eMagiz Store.WebHome||target="blank"]] | ||
53 | ** [[Accelerators (Navigation)>>doc:Main.eMagiz Store.Accelerators.WebHome||target="blank"]] | ||
54 | *** [[PDF to PNG (Explanation)>>doc:Main.eMagiz Store.Accelerators.PDF to PNG.WebHome||target="blank"]] | ||
55 | * [[Novice (Menu)>>doc:Main.eMagiz Academy.Microlearnings.Novice.WebHome||target="blank"]] | ||
56 | ** [[Create your transformations (Navigation)>>doc:Main.eMagiz Academy.Microlearnings.Novice.Create your transformations.WebHome||target="blank"]] | ||
57 | *** [[XSLT Snippet (Explanation)>>doc:Main.eMagiz Academy.Microlearnings.Novice.Create your transformations.novice-create-your-transformations-xslt-snippet||target="blank"]] | ||
58 | *** [[XSLT Parameters (Explanation)>>doc:Main.eMagiz Academy.Microlearnings.Novice.Create your transformations.novice-create-your-transformations-xslt-parameters||target="blank"]] | ||
59 | * [[Crash Courses (Menu)>>doc:Main.eMagiz Academy.Microlearnings.Crash Course.WebHome||target="blank"]] | ||
60 | ** [[Crash Course Platform (Navigation)>>doc:Main.eMagiz Academy.Microlearnings.Crash Course.Crash Course Platform.WebHome||target="blank"]] | ||
61 | *** [[Support objects - Introduction (Explanation)>>doc:Main.eMagiz Academy.Microlearnings.Crash Course.Crash Course Platform.crashcourse-platform-create-support-objects-introduction||target="blank"]] | ||
62 | * [[Intermediate (Menu)>>doc:Main.eMagiz Academy.Microlearnings.Intermediate Level.WebHome||target="blank"]] | ||
63 | ** [[Create your transformations (Navigation)>>doc:Main.eMagiz Academy.Microlearnings.Intermediate Level.Create your transformations.WebHome||target="blank"]] | ||
64 | *** [[Default eMagiz XSLT Functions (Explanation)>>doc:Main.eMagiz Academy.Microlearnings.Intermediate Level.Create your transformations.intermediate-create-your-transformations-emagiz-xslt-functions||target="blank"]] | ||
65 | * [[XSL-FO (External)>>https://w3schools.sinsixx.com/xslfo/default.asp.htm||target="blank"]] | ||
66 | * [[PDF transformation (Search Result)>>url:https://docs.emagiz.com/bin/view/Main/Search?sort=score&sortOrder=desc&highlight=true&facet=true&r=1&f_space_facet=0%2FMain.&f_type=DOCUMENT&f_locale=en&f_locale=&f_locale=en&text=pdf+transformation||target="blank"]] | ||
67 | )))((({{toc/}}))){{/container}}{{/container}} |