3

I have a simplex scanner with document feeder, and am looking for the best way to scan double-sided notes. It would be useful to be able to scan the same stack twice, once flipped, and have a utility automatically interleave the scanned images. Multi-page PDF export would also be nice. Is there a tool to do this?

Otherwise, I'm considering writing it in Python, with the imagescanner module, if it can use the ADF -- http://pypi.python.org/pypi/imagescanner/0.9

Thanks

4 Answers 4

2

Old question, still relevant:

Use "simple scan". It has a "reorder pages" function. I found this hint here.

0

Scan the document as a PDF with the pages ordered as they were scanned, i.e. first all odd pages, then all even ones. Then fix it with:

pdftk raw.pdf cat odd even output ordered.pdf

See also Merge two PDF files containing even and odd pages of a book.

0

I do the following on my scanner with automatic document feeder (ADF):

  1. Scan odd pages from 1st to last, store as first pdf file
  2. Flip the stack of pages and scan even pages from last to 2nd, store as second pdf file
  3. Merge both files with a little PowerShell script that uses the PDFSharp library (the binaries need to be copied side-by-side with the PowerShell script)

Here's my script - a little rough - but work's for me. I hope it can help.

# Not entirely my code, this is based on Mike Pfeiffer - http://mikepfeiffer.net/2010/03/how-to-merge-pdf-files-using-powershell-and-pdfsharp/
# Requires PDFSharp assembly libraries http://sourceforge.net/projects/pdfsharp/
# You need to load the assembly before you can use the function            
#
# Usage:
# Merge-PDF -firstPdfPath 1.pdf -secondPdfPath 2.pdf -targetPdfPath merged.pdf
[CmdletBinding()]
param 
(
    $firstPdfPath,
    $secondPdfPath,
    $targetPdfPath
)
begin {
    $scriptPath = split-path -parent $MyInvocation.MyCommand.Definition
    Add-Type -Path .\PdfSharp.dll
}

process {
    $output = New-Object PdfSharp.Pdf.PdfDocument            
    $PdfReader = [PdfSharp.Pdf.IO.PdfReader]            
    $PdfDocumentOpenMode = [PdfSharp.Pdf.IO.PdfDocumentOpenMode]                        

    $firstPdfPath = Join-Path $PSScriptRoot $firstPdfPath
    $secondPdfPath = Join-Path $PSScriptRoot $secondPdfPath
    $targetPdfPath = Join-Path $PSScriptRoot $targetPdfPath

    $firstPdf = New-Object PdfSharp.Pdf.PdfDocument            
    $firstPdf = $PdfReader::Open($firstPdfPath, $PdfDocumentOpenMode::Import)  

    $secondPdf = New-Object PdfSharp.Pdf.PdfDocument            
    $secondPdf = $PdfReader::Open($secondPdfPath, $PdfDocumentOpenMode::Import)    
    $secondIndex = $secondPdf.Pages.Count-1

    foreach($page in $firstPdf.Pages) {
        $output.AddPage($page)
        if ($secondIndex -ge 0) {
            $output.AddPage($secondPdf.Pages[$secondIndex--])
        }
    }
    
    $output.Save($targetPdfPath)            
}

end {
}
-1

A low-tech solution. Scan once with the ADF increment set to +2 so you get the odd pages. Flip the stack, set the starting number to the last odd page number +1 and the increment to -2 to get the even pages in reverse order.

3
  • By odd page, do you mean the front side of all pages or one side of every other page? There is no increment option; I guess it's not an automatic document feeder. Sep 23, 2012 at 21:46
  • The front side of all pages.
    – W_Whalley
    Oct 1, 2012 at 13:12
  • My sane scanner control panel has options to set the number of pages scanned, the file name and path (for the save option), a number "value to be added to filenamecounter after scan", an option that "selects the scan source (such as a document feeder)". My scan source options are Auto and ADF, but either one feeds documents. Perhaps your scanner ADF is not supported by sane?
    – W_Whalley
    Oct 1, 2012 at 13:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .