Rename files with text extracted from a fixed position in PDF

Post Reply
mervinator
Newbie
Posts: 5
Joined: Tue Jun 25, 2013 12:35 am

Rename files with text extracted from a fixed position in PDF

Post by mervinator »

Is this doable in Switch and/or Pitstop Server?



There are interactive solutions for this using third party software like Evermap Autobatch and Easy PDF Renamer but I am looking for something that is totally hands-free and silently runs in the background.
dkelly
TOP CONTRIBUTOR
Posts: 658
Joined: Mon Nov 29, 2010 8:45 pm
Location: Alpharetta GA USA
Contact:

Rename files with text extracted from a fixed position in PDF

Post by dkelly »

I've implemented several flows like this using Apago PDFspy
mervinator
Newbie
Posts: 5
Joined: Tue Jun 25, 2013 12:35 am

Rename files with text extracted from a fixed position in PDF

Post by mervinator »

Hi Dwight, I downloaded the PDFspy trial but the switch configurator properties don't seem to offer a clue on how to go about extracting the text I want. So I guess it's not as straightforward as I hoped it would be. Is it just PDFspy or PDFspy + enormous amount of scripting that's required to do this? :)
dkelly
TOP CONTRIBUTOR
Posts: 658
Joined: Mon Nov 29, 2010 8:45 pm
Location: Alpharetta GA USA
Contact:

Rename files with text extracted from a fixed position in PDF

Post by dkelly »

You need a script to call PDFspy and process the text it extracts. Here's an example flow that does what you want.



https://www.dropbox.com/s/z8r32w7d9ed8u ... text.sflow



Cheers,

Dwight Kelly
lombert
Member
Posts: 167
Joined: Fri Feb 04, 2011 2:31 pm
Location: Sweden

Rename files with text extracted from a fixed position in PDF

Post by lombert »

dkelly wrote: You need a script to call PDFspy and process the text it extracts. Here's an example flow that does what you want.




Hi Dwight



How can I use this script, I have PDFSpy, but can't understand were in the pdf it looks for the text string? I tried to put a text string in the left bleed, but it didn't work. :(



I need to rename some impositions pdf and I think your script can help me..



/Thomas
Between jobs!
dkelly
TOP CONTRIBUTOR
Posts: 658
Joined: Mon Nov 29, 2010 8:45 pm
Location: Alpharetta GA USA
Contact:

Rename files with text extracted from a fixed position in PDF

Post by dkelly »

The property "Marker" is a regular expression that the script uses to locate the text on the page. The original flow had "Job#" so the script searches for "Job#" and then extracts the text after that and before the next white space.



So, "Job# 1234" would extract "1234"



It stores this value in the job's private data using the name "ExtractedName".
lombert
Member
Posts: 167
Joined: Fri Feb 04, 2011 2:31 pm
Location: Sweden

Rename files with text extracted from a fixed position in PDF

Post by lombert »

Thanks!



I have tested and I get this error:

"10/24/14 8:50 AM,Error,PDFspy text search,Rename using PDF text,PDFspy text search,39P41,340137 100 ex IF dfgdfgd.pdf,Could not extract text from PDF"



I'll guess that when it says that it can't find the "Job#" text?



EDIT: Now I got it to run. But my output file is named "Job#.pdf"?? That is wrong?



EDIT 2: NOW IT WORKS!! :D I needed to have a 'blank space' after the name to.. "Job# 1234 "
Between jobs!
dkelly
TOP CONTRIBUTOR
Posts: 658
Joined: Mon Nov 29, 2010 8:45 pm
Location: Alpharetta GA USA
Contact:

Rename files with text extracted from a fixed position in PDF

Post by dkelly »

Obviously you can customize the text to find, eg. Job#, to your specific requirements.
ArielRauch
Advanced member
Posts: 231
Joined: Thu Aug 07, 2014 10:04 am

Rename files with text extracted from a fixed position in PDF

Post by ArielRauch »

@Dwight,

would ApagoSpy also recognize Hebrew words (right-to-left + character set)?
dkelly
TOP CONTRIBUTOR
Posts: 658
Joined: Mon Nov 29, 2010 8:45 pm
Location: Alpharetta GA USA
Contact:

Rename files with text extracted from a fixed position in PDF

Post by dkelly »

It's possible but in the file I just tried the Hebrew characters were images not glyphs.
Post Reply