Hi @bgrabau,
I assume that the easiest way to solve your question is to do the following:
- Create a Text File based Data Mapping Configuration file.
- Add the Table “Lines” to the Data Model (panel) by right clicking on “record” and then selecting the option “Add Table…”.
- Add the Field “Line” to the just added Table by right clicking on “Lines” and then selecting the option “Add Field…” (in the Data Model panel).
- Add a Action Step to the Steps panel and add the following JavaScript code to the Actions script inside the Step Properties panel:
var txtFile = openTextReader(data.filename);
while((line = txtFile.readLine()) != null) {
record.tables.Lines.addRow({"Line": line});
}
txtFile.close();
- Create a Print Template file.
- Replace the Source of the Print Context Section “Section 1” with for example the following HTML code:
<div id="example"></div>
- Add a Standard Script to the Standard folder in the Scripts panel.
- Add the following JavaScript code to the just created Standard Script:
var result = "";
if("Lines" in record.tables) {
for(var i = 0; i < record.tables.Lines.length; i++) {
result += record.tables.Lines[i].fields.Line;
if(i + 1 < record.tables.Lines.length) {
result += "<br />";
}
}
}
results.html(result);
After executing the above steps you will only have to create a Job Creation Preset (optional) and Output Creation Preset (“Generic PDF” Printer Model) via: Connect Designer > File > Print Presets.
After creating all these files you will have to send them to Workflow and after that you will be able to create PDF output by executing the following OL Connect Workflow plugins:
- Folder Capture
- Execute Data Mapping
- Create Print Content
- Create Job
- Create Output