Using page labels in job name

Post Reply
User avatar
Terkelsen
Advanced member
Posts: 298
Joined: Thu Sep 08, 2011 5:08 pm
Contact:

Using page labels in job name

Post by Terkelsen »

I'm merging single page PDF's into one PDF. All the PDF's have specific page labels meaning that the first page in the PDF has page label 3 but I don't know how many pages are in the final PDF.



II want to name the merged PDF like this "[filename]_[first page label]-[last page label]" e.g. "Filename_3-162.pdf".



It's quite easy using "Rename Job" to add a suffix with the first page label since that is just Index 1.



But how can I add a suffix with the last page label when I don't know the number of pages and therefore not the exact Index of the last page label?
carineb
Member
Posts: 31
Joined: Wed Oct 20, 2010 2:39 pm

Using page labels in job name

Post by carineb »

Hi,



if you don't know beforehand the total number of pages, it won't be possible to use that while setting the name at the moment of executing the merge.



A possible solution would be to add a Rename tool after the merge, where you'll know the number of the first page label (as it's in your file name) and you'll know the total number of pages (available as Switch variable), so you can easily calculate the exact number of the last page label.



If you want to do everything at once (merging and renaming), you could use a script for the Acrobat configurator. A sample script that shows how to split files and use the page labels in the file name is already available for free: http://www.crossroads-world.com/en/home ... e%20lables



You can use this sample as a basis to develop your own 'all in one'. Of course if you'd like Enfocus to write such a script for you, that is possible too - in that case, please contact their Professional Services team at professionalservices@enfocus.com.



Hope this helps you creating your flow!



Kind regards,

Carine
dkelly
TOP CONTRIBUTOR
Posts: 658
Joined: Mon Nov 29, 2010 8:45 pm
Location: Alpharetta GA USA
Contact:

Using page labels in job name

Post by dkelly »

Terkelsen wrote:

But how can I add a suffix with the last page label when I don't know the number of pages and therefore not the exact Index of the last page label?


This is quite easy with a little scripting. Enumerate all of the files in the job directory, sort and extract the last filename. I've posted several similar scripts on Crossroads previously.
User avatar
Terkelsen
Advanced member
Posts: 298
Joined: Thu Sep 08, 2011 5:08 pm
Contact:

Using page labels in job name

Post by Terkelsen »

Thank you Carine for reminding me of the new calculation feature in update 4. That's really good news for those of us that are not programmers.



All I had to do to get the last page number was this:

[Switch.Calculation:Expression="(([Stats.PageLabels:Index=1]-1))+([Stats.NumberOfPages])"]



Thank you Dwight. I'll have a look at some of the scripts you posted earlier.
Post Reply