Hi,
I've set up a Datamatrixcode which should use the current PDF page. So that if I have a PDF file which contains of for example five pages, on page one the Datamatrixcode should contain "Page 1" and on page two it should conatin "Page 2" and so on. Am I blind or is there no variable which can figure out and then use current PDF page?
Thak you and best regards!
Using the current PDF page in variables?
Re: Using the current PDF page in variables?
Next to the Value field in the "Add barcode" Action there is a "Variable" button that offers a set of internal variables and %Page Number% is one of them, so you specify "Page %Page Number%" as the value.
There is a limitation: you cannot combine these variables with the variables from a variable set. Is that your problem?
There is a limitation: you cannot combine these variables with the variables from a variable set. Is that your problem?
Re: Using the current PDF page in variables?
Yes thats my Problem. I want to use Switch variabels to fill the Datamatrix code.
Re: Using the current PDF page in variables?
It is not the nicest solution, but what you can do is split the PDF and ungroup the job. The page number is now at the end of the name proper, which means it is available in the variable [Job.NameProper:Search="\d+$"] (take the digits at the end of the name proper). You can combine this variable with other variables to create the value for the variable that will be used in the Action List. Follow up with Assemble job/Scheme - Ungrouped job/Merge PDF.
Re: Using the current PDF page in variables?
Thanks for that tip, was a little bit tricky but now it works. Theres just one more problem, I need the page number as a two digit number, so it shouldn't be 1 but 01 ans so on. Because I have to make a calculation (to get the sheet number and not only the page number) I don't know how to solve this. Any ideas?
At the moment the variable looks like this
[Switch.Calculation:Expression="round([Job.NameProper:Search="\d+$"]/2)"]
At the moment the variable looks like this
[Switch.Calculation:Expression="round([Job.NameProper:Search="\d+$"]/2)"]
Re: Using the current PDF page in variables?
Is it not conceptually better to split the file in groups of 2 pages? If so, use the "Split PDF pages" app. This one has support for naming the files based on the group number as well as on the page number (see the documentation). Splitting in groups of 2 then means that the first 2 pages are called _01 (or _001) at the end, pages 3 and 4 _02, etc. You can then use those digits without a Switch.Calculation and the leading zeroes will not disappear.
Re: Using the current PDF page in variables?
Yes thats better, works now. Thanks for your support!
Re: Using the current PDF page in variables?
And you can't combine a data set variable *and* static text either, which is what I hoped I could do. LAME.freddyp wrote: ↑Mon Oct 17, 2022 6:14 pm Next to the Value field in the "Add barcode" Action there is a "Variable" button that offers a set of internal variables and %Page Number% is one of them, so you specify "Page %Page Number%" as the value.
There is a limitation: you cannot combine these variables with the variables from a variable set. Is that your problem?
Re: Using the current PDF page in variables?
In PitStop you cannot combine a variable with static text but when defining the value of the variable in Switch you can combine any Switch variable with static text, so it is possible.
Re: Using the current PDF page in variables?
True, thanks for that.