Kal Posted February 18, 2015 Share Posted February 18, 2015 Does anyone have a script that will read a PDF and return the number of pages within the PDF? Quote Link to comment Share on other sites More sharing options...
ThomasLewis Posted February 19, 2015 Share Posted February 19, 2015 Give this a shot: return CreateResource("filename.pdf", "graphic").countPages; Quote Link to comment Share on other sites More sharing options...
Kal Posted February 19, 2015 Author Share Posted February 19, 2015 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 Quote Link to comment Share on other sites More sharing options...
ThomasLewis Posted February 19, 2015 Share Posted February 19, 2015 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. Quote Link to comment Share on other sites More sharing options...
Kal Posted February 19, 2015 Author Share Posted February 19, 2015 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. Quote Link to comment Share on other sites More sharing options...
ThomasLewis Posted February 19, 2015 Share Posted February 19, 2015 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. return CreateResource(Field("PD_GRAPHIC"), "graphic").countPages; Quote Link to comment Share on other sites More sharing options...
Kal Posted February 19, 2015 Author Share Posted February 19, 2015 Thank you Thomas. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.