Adding multi-line text to PDF with VariableSets

Post Reply
jterrano
Newbie
Posts: 6
Joined: Thu Nov 04, 2021 8:00 pm

Adding multi-line text to PDF with VariableSets

Post by jterrano »

I am attempting to apply multi-line text to an action list through a variable set.

The multi-line text shows :

in x-path :

Code: Select all

<Column Name="DetailDescription" DataType="STRING">LUX_CP 3030347
Standard Hours Sign
18"x30"
.020 Stryene Dead White
4/0
4-Holes Drilled in Corners</Column>
as utf-8 :

Code: Select all

<Column Name="DetailDescription" DataType="STRING">LUX_CP 3030347&#13;
Standard Hours Sign&#13;
18"x30"&#13;
.020 Stryene Dead White&#13;
4/0&#13;
4-Holes Drilled in Corners</Column>
When i attempt to apply DetailDescription to private data, I am given an error that states that the following lines must start with a key=tag
Standard Hours Sign
18"x30"
.020 Stryene Dead White
4/0
4-Holes Drilled in Corner

When i attempt to apply the DetailDescription as a variable set, pitstop will only pull the first line in "LUX_CP 3030347"

I've tried changing the &#13 to &#133, which from what I have found is a utf-8 encoding:

&#13 = Control character: Carriage Return (cr)
&#133 = Control character: Next Line (nel)

I have exhausted all options as far as i can think and really hope someone may be able to provide assistance... overall the goal is to take this multi-line detail description and write it to a PDF as i am attempting to generate job tickets for production.
User avatar
JimmyHartington
Advanced member
Posts: 316
Joined: Tue Mar 22, 2011 7:38 am

Re: Adding multi-line text to PDF with VariableSets

Post by JimmyHartington »

As far as I know it is not possible to add multilines in with Pitstop.

If you create the jobticket from scratch maybe it is better to write a HTML and convert it to PDF with tools for that.

I have used custom written HTML with web-fonts, converted to pdf with Chrome and lastly placed into an existing PDF.
This way I could achieve multilines pdf from Switch variables.
User avatar
john.dean@esko.com
Member
Posts: 29
Joined: Tue Aug 13, 2019 8:23 pm
Location: Chicago

Re: Adding multi-line text to PDF with VariableSets

Post by john.dean@esko.com »

Adding multiline text in PitStop is indeed on the feature request list that is being reviewed.
Somewhat familiar with Enfocus products.
Malcolm Mackenzie
Member
Posts: 121
Joined: Wed Mar 22, 2017 5:05 pm
Location: London, UK
Contact:

Re: Adding multi-line text to PDF with VariableSets

Post by Malcolm Mackenzie »

I've done this line by line.
Bit fiddly but once done it worked.
It might help someone here.
Add object and set offset.
Add object change offset up/down or across
Screenshot 2022-05-27 at 15.39.35.png
Screenshot 2022-05-27 at 15.39.35.png (40.82 KiB) Viewed 3146 times
schmitzdp
Member
Posts: 47
Joined: Thu Aug 06, 2020 1:36 pm

Re: Adding multi-line text to PDF with VariableSets

Post by schmitzdp »

john.dean@esko.com wrote: Tue May 24, 2022 8:54 am Adding multiline text in PitStop is indeed on the feature request list that is being reviewed.
Has this feature finally been added ?

Because I'd like to use this feature to generate PDFs.

Thank you
loicaigon
Advanced member
Posts: 401
Joined: Wed Jul 10, 2013 10:22 am

Re: Adding multi-line text to PDF with VariableSets

Post by loicaigon »

Hi all,

Sorry to bear the bad news but this is not implemented yet. We keep it on our roadmap but for now higher priority features were done.
Feel free to contact support so that they can register your feature request. You will be then notified as soon as this feature is made available.

Loic
User avatar
JimmyHartington
Advanced member
Posts: 316
Joined: Tue Mar 22, 2011 7:38 am

Re: Adding multi-line text to PDF with VariableSets

Post by JimmyHartington »

schmitzdp wrote: Wed May 15, 2024 3:10 pm Because I'd like to use this feature to generate PDFs.
What kind of pdf do you need to create?
As earlier stated I have had success with writing HTML with Switch variables and then converting this HTML to PDF and place in other artwork with Pitstop.

Or more recently I have use this app https://www.enfocus.com/en/appstore/pro ... m-template which has a JSON-file as input and then outputs HTML. I have used it for order confirmations, order sheets for production and packaging slips. You can also add Private Data variables to the template.
schmitzdp
Member
Posts: 47
Joined: Thu Aug 06, 2020 1:36 pm

Re: Adding multi-line text to PDF with VariableSets

Post by schmitzdp »

loicaigon wrote: Wed May 15, 2024 5:29 pm Hi all,

Sorry to bear the bad news but this is not implemented yet. We keep it on our roadmap but for now higher priority features were done.
Feel free to contact support so that they can register your feature request. You will be then notified as soon as this feature is made available.

Loic
Hi Loic,

OK, I'll contact them to submit this feature. ;)
schmitzdp
Member
Posts: 47
Joined: Thu Aug 06, 2020 1:36 pm

Re: Adding multi-line text to PDF with VariableSets

Post by schmitzdp »

JimmyHartington wrote: Thu May 16, 2024 7:34 am
schmitzdp wrote: Wed May 15, 2024 3:10 pm Because I'd like to use this feature to generate PDFs.
What kind of pdf do you need to create?
As earlier stated I have had success with writing HTML with Switch variables and then converting this HTML to PDF and place in other artwork with Pitstop.

Or more recently I have use this app https://www.enfocus.com/en/appstore/pro ... m-template which has a JSON-file as input and then outputs HTML. I have used it for order confirmations, order sheets for production and packaging slips. You can also add Private Data variables to the template.
Hi Jimmy,

I tested this app. I generate my HTML file. ;) Then, do you use a specific app or the ‘wkhtmltopdf’ command to convert to PDF ?

I have installed wkhtmltopdf and have tested this command (with app execute command) without success

Code: Select all

C:\Program Files\wkhtmltopdf\bin\wkhtmltopdf.exe C:\Temp\test.html C:\Temp\test.pdf
Do you have an idea to fix it?
Thanks
User avatar
JimmyHartington
Advanced member
Posts: 316
Joined: Tue Mar 22, 2011 7:38 am

Re: Adding multi-line text to PDF with VariableSets

Post by JimmyHartington »

I use Google Chrome to convert HTML to PDF.
With the Execute Command with these settings:
Image

And my "Convert HTML to pdf with Chrome.cmd" file contains this code:

Code: Select all

"C:\Program Files\Google\Chrome\Application\chrome.exe" --headless --disable-gpu  --no-pdf-header-footer --print-to-pdf=%2 --no-margins %1
loicaigon
Advanced member
Posts: 401
Joined: Wed Jul 10, 2013 10:22 am

Re: Adding multi-line text to PDF with VariableSets

Post by loicaigon »

Am I surprised by your inventivity Jimmy?

By the way, are you aware of Puppeteer? https://pptr.dev/guides/pdf-generation
But maybe that's what you cmd does?
User avatar
JimmyHartington
Advanced member
Posts: 316
Joined: Tue Mar 22, 2011 7:38 am

Re: Adding multi-line text to PDF with VariableSets

Post by JimmyHartington »

I just use the tools at my disposal :D

I have looked into Puppeteer. Have made a Script Element which uses it from a NPM-package. Am still testing if I like it better than using an installed version of Chrome.
As I understand then Puppeteer is using Chromium for this, so it is essentially the same method as Chrome.
There is some difference in font handling with the two methods. With Puppeteer I can use a ttf-font the web (could not the woff to work). With Chrome I could only get local installed fonts to work.
So this means the HTML needs to be crafted different for each use case.
schmitzdp
Member
Posts: 47
Joined: Thu Aug 06, 2020 1:36 pm

Re: Adding multi-line text to PDF with VariableSets

Post by schmitzdp »

JimmyHartington wrote: Thu May 16, 2024 1:07 pm I use Google Chrome to convert HTML to PDF.
With the Execute Command with these settings:
Image

And my "Convert HTML to pdf with Chrome.cmd" file contains this code:

Code: Select all

"C:\Program Files\Google\Chrome\Application\chrome.exe" --headless --disable-gpu  --no-pdf-header-footer --print-to-pdf=%2 --no-margins %1
Thank you Jimmy for sharing this information. :D

I was able to generate my PDF as I wished by integrating my multi-line text (created in HTML then in PDF and finally this PDF was inserted into my PDF template at the desired position with Pitstop).
User avatar
JimmyHartington
Advanced member
Posts: 316
Joined: Tue Mar 22, 2011 7:38 am

Re: Adding multi-line text to PDF with VariableSets

Post by JimmyHartington »

You are welcome.

Glad to hear you got it to work.

But still. The ability to add multiline text with Pitstop would be nice. :)
Post Reply