Page 1 of 1

Capture page count in multiple PDF files

Posted: Sat Apr 29, 2017 5:48 am
by beastridge
Looking for a way to capture the file name and page count in many, over 10,000, PDF files and write to a text or csv file. The files are nested in 100's of folders and sub folders. Currently we have a csr writing this data into a spreadsheet but that is very time consuming. This is done, more or less, for data collection to determine job costs. Each file has a copy count of two, so the quantity of each is static. I am trying to get approval to purchase the database module but until then I wanted to see if there was another way to do this in Switch. We do have the scripting module but I am not knowledgeable enough with scripting to do this at this time. :? Thank you for your time!

Re: Capture page count in multiple PDF files

Posted: Tue May 02, 2017 10:06 pm
by bleuprocess
Hi beastridge :)

I developed a script/module, which allows to do exactly what you are looking for (amongst a lot of other things - basically, you can log anything in a txt/csv file - it is completely configurable and this will suit many more use cases than only this one).
The cost of this script is much cheaper than the database module (and everything logged here would be possible to be imported to a database the day you would like to upgrade to the database module).
If you are interested in, just PM me and I'll explain more about it.

Best,
Christian

Re: Capture page count in multiple PDF files

Posted: Wed May 03, 2017 4:27 pm
by gabrielp
You can also do some database stuff with this script: https://github.com/open-automation/switch-sql-query

Re: Capture page count in multiple PDF files

Posted: Thu Oct 12, 2017 5:32 pm
by Dave23
Hi,

I was wondering gabrielp do you by any chance have a flow that has this script working? i'm quite new to switch and I can't seem to get it to work.

Cheers

Re: Capture page count in multiple PDF files

Posted: Thu Oct 12, 2017 6:43 pm
by gabrielp
I don't have any off hand. The trickiest part of using this script is configuring an ODBC connection. If you have specific questions, you may find some help here: https://gitter.im/open-automation/Lobby

Re: Capture page count in multiple PDF files

Posted: Tue Oct 17, 2017 11:30 am
by Dave23
Alright gabrielp, apologies I have tried looking on the link you provided but couldn't find much on that script. I have created ODBC connections which work great with the database module that I have. I just thought maybe this script will make creating a csv file quicker if in fact it actually does this?

What I am currently doing is using sed via execute command I am writing one row at a time to a csv file from sql. I wanted to make this process quicker by writing multiple lines, i thought maybe this script could help with this? Although i cannot seem to execute it properly. In the sql query I have put in multiple select statements, query type: Direct and result type: multiple result value.

Cheers

Re: Capture page count in multiple PDF files

Posted: Tue Oct 17, 2017 4:23 pm
by gabrielp
You can use this script to pull out multiple rows as an XML dataset. Then you can look for a script/app or build one which converts XML to CSV.