Showing posts with label pdf. Show all posts
Showing posts with label pdf. Show all posts

Tuesday, 9 November 2010

Quickly search several PDFs at once

Takes PDFs as arguments, and can be used with nautilus-actions or thunar's custom actions. The script uses grep and thus grep regex, but i've added easy conditional searching at the expense of some limitations regarding normal grep conditionals. You're presented with this when you run it, which just about covers things:

The search ignores case. Conditionals cannot be joined. Let me know if this is a problem.
Wildcards:
A single . represents any character, and an asterisk represents zero or more occurances of the preceeding character eg:
'c...h' will find catch, clash, cloth, coach etc.
'c.*h' will find caliph, cash, catch, cheesecloth etc.
Conditionals:
OR : '(this|that|the)' will show lines containing 'this', 'that', or 'the'.
AND : '(this&&that&&the)' will search for lines that contain 'this', 'that' and 'the'.
NOT : '(this!that)' will search for lines that contain 'this' but don't contain 'that'

The script can be downloaded here. You'll need pdftotext for this to work.

Saturday, 10 July 2010

Merge and burst PDFs with nautilus-actions

Two scripts, one for merging and one for bursting (splitting up into single pages). Grab them here.

They output to the directory the PDFs are in. The merge script collates the PDFs in alphabetical order and outputs to 'merged.pdf', the burst script numbers the pages.

Add it to nautilus-actions the normal way, with %M as the parameter and to only show when *.pdf is displayed, obviously.

These scripts rely on pdftk to do the work.