Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Scan many pages (almost) directly into a combined PDF Scanners
I have to print, sign, scan, and email a lot of documents, and have been seeking out an easy way to do it for a while. It's been particularly aggravating for multi-page documents, because Image Capture saves each scan as an individual file. There are a couple of tools that can scan directly to PDF, but they cost about $60 or more, and that's a lot for a simple function like this, in my opinion. Today I hit upon an extremely easy way of scanning directly to PDF format that uses freeware tools:
  1. Get your scanner all set up, using whatever drivers you need. (This can sometimes be a bear on OSX. If your scanner manufacturer doesn't provide a driver, check out the SANE project; they may have something for you).
  2. Download and install CombinePDF, a really fantastic little tool that I've found handy on many occasions.
  3. Connect your scanner to your Mac and fire up Image Capture.
  4. In the toolbar to the right, click on the drop-down next to Automatic Tasks.
  5. Click on "Other..."
  6. Browse to wherever CombinePDF is installed, select it, and click Open.
  7. Now insert your document into the scanner and click Scan.
  8. As each page is scanned, its file will be dumped into CombinePDF. So this works for multi-page documents, too -- each page will appear as a filename in CombinePDF.
  9. When all of your pages are scanned in, click on "Merge PDF..." in CombinePDF.
  10. Select a location for the final PDF and give it a name, then click OK.
That's it -- when you click OK, your combined PDF will be created. I originally posted this on my blog.
    •    
  • Currently 1.79 / 5
  You rated: 1 / 5 (47 votes cast)
 
[110,610 views]  

Scan many pages (almost) directly into a combined PDF | 18 comments | Create New Account
Click here to return to the 'Scan many pages (almost) directly into a combined PDF' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Scan many pages (almost) directly into a combined PDF
Authored by: joose on Jun 13, '07 08:16:41AM

This is nice, but what I would like to see, is even more automated scanning. Say, running a script and it would scan document and place it in a directory X. I've tried to find how to do this, but not yet found any solution. Combining this hint and someway to automaticly scan documents would be killer helper =)



[ Reply to This | # ]
Scan many pages (almost) directly into a combined PDF
Authored by: MaryT on Jun 13, '07 08:54:55AM
I believe Vuescan can do this, although I haven't tried to do it . It's $39.95 and well worth the money IMHO.

[http://www.versiontracker.com/dyn/moreinfo/macosx/7610]

Mary

[ Reply to This | # ]
Scan many pages (almost) directly into a combined PDF
Authored by: umijin on Jun 13, '07 09:10:27AM

Hmmm... Interesting idea. I've never used image capture for scanning.

I've also not heard of "CombinePDF", but have used PDFLab to combine pdf or other files into one pdf file.

I'd be interested to see if you could use PDFLab in place of CombinePDF here.



[ Reply to This | # ]
Scan many pages (almost) directly into a combined PDF
Authored by: jasquigl on Jun 13, '07 09:21:18AM

you can



[ Reply to This | # ]
Scan many pages (almost) directly into a combined PDF
Authored by: rhowell on Jun 13, '07 09:43:52AM

Hmm, I wonder if you can pipe ImageCapture into Automator's "Combine PDF Pages" action, thus removing the need for 3rd party software.

Not that 3rd party software is bad! (doh, remembering its WWDC week, heh).



[ Reply to This | # ]
Scan many pages (almost) directly into a combined PDF
Authored by: jackb79 on Jun 13, '07 09:54:38AM

Instead of printing them out, why not create a high quailty scan of your signature (in color) and overlay that on the PDF you intend to sign. I use pages to do this, place the page needing the signature in pages then take the signature image and place it where it's supposed to go then export the resulting file as a pdf. This creates a much smaller file and doesn't wast paper or ink and saves time. Way to go I say



[ Reply to This | # ]
Scan many pages (almost) directly into a combined PDF
Authored by: mankoff on Jun 13, '07 10:48:13AM

Amen. Or get a Wacom Tablet!

---
http://spacebit.dyndns.org



[ Reply to This | # ]
OS X includes a Python script to do this
Authored by: pknotz on Jun 13, '07 10:45:41AM
OS X has a python script to do this -- it's included with Automator. Here's an example of how to run it:
/usr/bin/python '/System/Library/Automator/Combine PDF Pages.action/Contents/Resources/join.py' -o combined.pdf page1.pdf page2.pdf page3.pdf


[ Reply to This | # ]
Automator variant
Authored by: Arlo on Jun 13, '07 01:39:55PM
This recently posted Automator workflow combines images into a single PDF:
http://automatorworld.com/archives/convert-images-to-combined-pdf/

Saves as a plugin for a folder action, it should be able to work similary to the original hint.

---
www.automatorworld.com
"Better Living Through Macintosh Scripting"

[ Reply to This | # ]

Scan many pages (almost) directly into a combined PDF
Authored by: Jwink3101 on Jun 13, '07 01:41:37PM

I have done something like this in Photoshop. I guess that isn't really cheaper alternative but i already owned it.



[ Reply to This | # ]
Scan many pages (almost) directly into a combined PDF
Authored by: chrisleuty on Jul 05, '07 03:05:31PM
GraphicConverter can scan to a multi-page PDF (and much, much more).

http://www.lemkesoft.com/

[ Reply to This | # ]
Scan many pages (almost) directly into a combined PDF
Authored by: Bbergeret on Jul 05, '07 07:56:17PM
Depending on what you need, you might find www.qipit.com convenient: just take a picture of all the pages of your document (with your iPhone, camera phone, or digital camera) and email them (in one single email, preferrably from your PC / Mac to avoid drastic resizing by most email clients on handsets -- including on the iPhone) to copy@qipit.com (or color@qipit.com) and you'll get a multiple-pages PDF scan of your document -- free of charge.

My 2 cents.

Benoit (qipit, inc.)

[ Reply to This | # ]
Combining the hints, and making it more secure
Authored by: klktrk on Oct 02, '07 12:42:08AM

Taking the hints above into account, I made an Automator application (or workflow), like so. My goal here was to build a more secure version of the hints above. It's not a good idea to leave pdfs lying around in /private/tmp. So I both made sure to store working files a little more securely, and to clean them up afterwards.

Also, I overrode the built in PDF combine pdfs action, since it outputs its result to the /private/tmp folder as well. I made it output its pdf to the Desktop instead:

  1. drop in Get selected Finder items action
  2. drop in the Finder sort items action
  3. drop in the Automator: run applescript item
  4. drop the code below into the applescript item
  5. drop in the Finder open items in Finder action

Here's the AppleScript, based on the great script developed by Rhet Turnbull in his Convert Images to Combined PDF workflow, upon which this comment is based.


on run {input, parameters}
	set selected_pdfs to {}
	set pic_names to ""
	--make unique md5 hash out of combined string of input files
	tell application "Finder" to set the selected_pic_names to input
	repeat with i from 1 to the count of selected_pic_names
		set pic_name to (item i of selected_pic_names)
		set pic_names to pic_names & pic_name
	end repeat
	set hash to (do shell script "/sbin/md5 -q -s " & quoted form of pic_names)
	set uid to (do shell script "/usr/bin/id -u")
	set tmp_path to "/private/tmp/" & uid & "/" & hash & "/"
	set out_path to POSIX path of (path to desktop folder)
	set out_pdf to out_path & hash & ".pdf"
	set pdfs to ""
	set mkdir to "/bin/mkdir -p -m 755 " & tmp_path & " ; /bin/chmod 700 " & tmp_path & " ; /usr/sbin/chown " & uid & ":" & uid & " " & tmp_path
	set rmdir to "/usr/bin/cd " & tmp_path & " ; /bin/rm -Rf " & tmp_path --need to cd here for safety's sake. don't want to wipe drive if odd bug should occur
	try
		do shell script mkdir
	on error
		display dialog "There was an error running this command: " & mkdir with icon caution
		quit
	end try
	
	tell application "Finder" to set the selected_pics to input
	repeat with i from 1 to the count of selected_pics
		set picitem to (item i of selected_pics) as alias
		set in_pic to POSIX path of picitem
		set outpic to POSIX file in_pic
		try
			set text item delimiters to ":"
			set file_name to last text item of (alias outpic as text)
			set text item delimiters to ""
		on error
			set text item delimiters to ""
		end try
		set outpic to tmp_path & file_name
		set outpic to (removeExtension(outpic)) & ".pdf"
		do shell script "/System/Library/Printers/Libraries/./convert" & " -f " & quoted form of in_pic & " -o " & quoted form of outpic
		
		set outpic_name to alias (POSIX file outpic)
		set selected_pdfs to selected_pdfs & outpic_name
		set pdfs to pdfs & quoted form of outpic & " " -- construct files to pass to python script
	end repeat
	set combine_script to "/usr/bin/python '/System/Library/Automator/Combine PDF Pages.action/Contents/Resources/join.py' -o  " & out_pdf & " " & pdfs
	try
		do shell script combine_script
	on error
		display dialog "Could not combine the pdf files. Python script failed." with icon caution
	end try
	--clean up
	try
		do shell script rmdir
	on error
		display dialog "There was an error while trying to remove temporary files with this command: " & rmdir with icon caution
	end try
	return alias (POSIX file out_pdf) -- send combined pdf to next action
	--	return selected_pdfs
end run

-- remove extension
on removeExtension(in_pic)
	set outpic to {}
	set AppleScript's text item delimiters to "."
	return first text item of in_pic
end removeExtension

---
The Apotek
http://theapotek.com
The Executioner's Summary:
http://www.last.fm/label/Broken+Hill+Music/playlists/6761?autostart

[ Reply to This | # ]

Combining the hints, and making it more secure
Authored by: Krioni on Jan 19, '11 02:40:54PM
That removeExtension function is potentially a problem. If your file's path has a dot anywhere other than just before the file extension, the result will be very wrong.

As an example, the following:

removeExtension( "/Users/someguy/Desktop/file.with.dots.tiff" )
would return:
"/Users/someguy/Desktop/file"
Even worse if there is a dot somewhere higher in the path:
removeExtension( "/Users/someguy/Documents/folder.with.dots/somefile.tiff" )
would return:
"/Users/someguy/Documents/folder"
Here's a replacement:
-- remove extension
on removeExtension(in_pic)
	set {oldDelims, AppleScript's text item delimiters} to {AppleScript's text item delimiters, "."}
	set out_pic to (text items 1 thru -2 of in_pic) as string
	set AppleScript's text item delimiters to oldDelims
	return out_pic
end removeExtension
---
http://www.danshockley.com


[ Reply to This | # ]
Scan many pages (almost) directly into a combined PDF
Authored by: lisanik on Oct 04, '07 01:49:05PM

That completely helped me and worked so well. Easiest little tool to use. Thank you thank you thank you!!!



[ Reply to This | # ]
Scan many pages (almost) directly into a combined PDF
Authored by: gibarian on Dec 09, '09 11:14:30AM

This is a great trick - but, "automatic task" seems to have been removed in snow leopard. Am I missing something?

Apple giveth, apple taketh away.



[ Reply to This | # ]
Image Capture 6.0.1 (428)
Authored by: Interactive on Dec 10, '10 04:24:40PM
The latest version of Image Capture has an option Create single document if you select PDF under Format.

[ Reply to This | # ]
Image Capture 6.0.1 (428)
Authored by: traco on Dec 12, '10 04:57:59AM

I wonder where I can find this option. I have Image Capture 6.0.1 (428) too, but when I select Format: PDF, the only option that apears below is "Image Correction".



[ Reply to This | # ]