Text to SPLF

Text to SPLF

One of the valid input formats of InterFormNG2 is text files. If you e.g. want to use data from an input text file in either an email or in a template, then you first need to convert the text file into the SPLF format. You can use the basic, converter workflow component, Text to SPLF for that.

 

In order to select this component the payload must be TEXT e.g. by selecting TEXT as the input file type in the workflow.

The component has these input parameters:

  1. Character encoding
    Here you can state the encoding of the input text file. The default encoding is UTF-8.
  2. Page break byte sequence (in hex)
    In the input text file there might be one or multiple characters to indicate a page break. You need to define this as a hex encoding sequence of byte. The default indicator is Form Feed (hex 0C) as shown above.

The input text file may only contain text.

If you e.g. convert a text file with these lines:

Mary had a lamb.
My dad is stronger than your dad.

 

Then the component will convert it into this SPLF file:

<?xml version="1.0" encoding="UTF-8"?>
<spool splfVersion="2.0">
<page>
<line>Mary had a lamb.</line>
<line>My dad is stronger than your dad.</line>
</page>
</spool>



You can verify the output of the conversion e.g. with the To filesystem component:

You can also use the converted spooled file as input for a merge with a template into e.g. printemail or PDF.

    • Related Articles

    • TEXT

      It is possible to define a workflow, that accepts text files as input. The default encoding is UTF-8. You need to convert the input text file into a spooled file, if you want to use a text file as input for a merge with a template. You can do that ...
    • PDF to splf component

      IMPORTANT! DO NOT use this feature in the 1.9.0 version, as an important change was made in the next version, which changed the behavior of existing definitions. InterFormNG2 can extract text from a PDF file and put the extracted text into the ...
    • Splf extractor: Conditioned mappings

      Both the line and block element can be conditioned in the spooled file extractor. To condition an element you should first select the area in the spooled file view and create a simple mapping. Now you need to enable triggers on the right in order to ...
    • Splf extractor: Tokens

      In the spooled file extractor you can build conditions to conditionally select section of the spooled file. Whenever you add a condition you compare the selected text with a token. Predefined tokens InterFormNG2 is delivered with these predefined ...
    • Splf extractor: Simple mapping

      The spooled file extractor selects data from all the pages of the spooled file. The output XML file is a file with a node for each spooled file page, so it is very each to see from which spooled file page the XML data was extracted. First you need of ...