MarcomCentral (PTI) and FusionPro User Communities

MarcomCentral (PTI) and FusionPro User Communities (http://forums.pti.com/index.php)
-   Issues, Questions, Etc. (http://forums.pti.com/forumdisplay.php?f=40)
-   -   Output PDF page number (http://forums.pti.com/showthread.php?t=4080)

Kal February 18th, 2015 03:31 PM

Output PDF page number
 
Does anyone have a script that will read a PDF and return the number of pages within the PDF?

ThomasLewis February 18th, 2015 06:25 PM

Re: Output PDF page number
 
Give this a shot:

Code:

return CreateResource("filename.pdf", "graphic").countPages;

Kal February 19th, 2015 10:39 AM

Re: Output PDF page number
 
Thanks Thomas but...

I get over 10,000 pdf's weekly and I have a data field called "PD_GRAPHIC" that pulls them in so how can I revise what you wrote to use that field to count the pages?

Thanks
Kal

ThomasLewis February 19th, 2015 10:48 AM

Re: Output PDF page number
 
Quote:

Originally Posted by Kal (Post 16292)
Thanks Thomas but...

I get over 10,000 pdf's weekly and I have a data field called "PD_GRAPHIC" that pulls them in so how can I revise what you wrote to use that field to count the pages?

Thanks
Kal

I have no idea what you mean by "pulls them in". Does it create a 10,000 record input file you use in FusionPro? Where do you want the page numbers displayed?

Sample files showing your input and expected output would be helpful.

Kal February 19th, 2015 11:11 AM

Re: Output PDF page number
 
Hi, my data has 10,000 records and the field "PD_GRAPHIC" has all the PDF names and I'm using that field to do a graphic image pull into a FusionPro letter.

I just want to use that same data field in FusionPro to return how many pages there are within the PDF and I'm going to print that number on the letter.

Hope that makes sense.

ThomasLewis February 19th, 2015 11:21 AM

Re: Output PDF page number
 
In that case it is just a matter of putting the field name in. This would go in a regular text rule. Just call the rule wherever you need to put the page count number.

Quote:

return CreateResource(Field("PD_GRAPHIC"), "graphic").countPages;

Kal February 19th, 2015 11:29 AM

Re: Output PDF page number
 
Thank you Thomas.


All times are GMT -7. The time now is 05:37 AM.

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2022, Jelsoft Enterprises Ltd.
(c) 2011, PTI Marketing Technologies™, Inc.