Results 1 to 3 of 3

Thread: Is there an easy way to combine PDF files?

  1. #1

    Default Is there an easy way to combine PDF files?

    Hi,

    I store a lot of PDF files in a single archive folder in Eaglefiler. The PDF files are from my Fujitsu Scansnap.

    Things are working well. I have a few Applescripts to help my workflow. And I use PDFPen to edit the PDF files (getting rid of pages, or combining PDF files into 1).

    Just wondering if anyone has an easy way of selecting 3-4 PDF files in EagleFiler, and combining them into a single PDF file? While deleting the original PDF files. There are paywares and freewares that combine PDF files. As mentioned, I use PDFPen. But it's a bit clunky: because it involves opening the PDFFiles, selecting the pages, combining, saving, and then deleting the original files.

    Has anyone written an Applescript that automates this? Otherwise, one of these months I'll try to have a look about trying.

    Thanks.

  2. #2

    Default

    Just replying to my own message. (By the way, Michael Tsai, I haven't figured out a way to create or reply to private messages).

    After playing around with PDFPen's Applescript library, I've figured out a way to easily combine PDFs.

    Combining PDFs in PDFPen can be done without Applescript, but involves switching page views, selecting all, copy and pasting, which is a drag when I have 3 years worth of PDF files. Using AppleScript is much faster.

    This results in one of the PDF files (the front one in PDFPen) having all the pages from the other files. Those other files are closed, but have to be manually deleted from EF.

    This is the script I used. I'm not a very proficient AppleScript user. Feel free to change.

    Code:
    --combines PDF files. 
    --adds files from behind the front window, to the back of the front 
    --window. The arrangement of the final PDF pages, is determined by 
    --how the user "arranged" them by clicking on each one in turn. 
    --At the end, the only PDF file open, contains all the pages 
    --from all the other PDF files. Those files can be deleted from EagleFiler. 
    --EagleFiler will alter the page count on the final file, only when that
    --file is previewed in EagleFiler. 
    tell application "PDFpen"
        set NumDocs to count documents -- how many documents are open 
        if NumDocs > 1 then
            -- copy pages from each document to the front (or back) of the first document
            repeat with CurrDoc from 2 to NumDocs
                duplicate pages of document CurrDoc to back of pages of document 1
            end repeat
            tell document 1 to save -- save the front document 
        end if
        
        -- NOW, close all the windows except the front one (the one with the combined files. 
        if NumDocs > 1 then
            repeat with CurrDoc from 2 to NumDocs
                -- because documents are always closing, just close the 2nd document all the time. 
                close document 2
            end repeat
        end if
    end tell
    Last edited by Michael Tsai; 09-19-2008 at 12:18 PM. Reason: Formatted script to be narrower.

  3. #3

    Default

    Quote Originally Posted by p694v7x View Post
    (By the way, Michael Tsai, I haven't figured out a way to create or reply to private messages).
    In order to prevent spam, only users who have posted a certain number of times can send private messages. (The restriction is in place if it says “New Member” next to your name.) You can always reach me by e-mail, of course.

    Quote Originally Posted by p694v7x View Post
    After playing around with PDFPen's Applescript library, I've figured out a way to easily combine PDFs.
    Cool. Automator also has a built-in action that can do this, although I think that wants to create a new PDF file rather than replace an existing one.

Similar Threads

  1. Tag interface for PDF printing?
    By phren0logy in forum EagleFiler
    Replies: 2
    Last Post: 11-23-2010, 05:32 PM
  2. Moving captured PDF out of EF
    By RFBriggs in forum EagleFiler
    Replies: 2
    Last Post: 08-20-2008, 12:20 PM
  3. EF Record Title from PDF Files
    By Dave Emme in forum EagleFiler
    Replies: 1
    Last Post: 01-01-2008, 03:20 PM
  4. PDF Spam Filtering
    By droog in forum SpamSieve
    Replies: 17
    Last Post: 08-03-2007, 02:52 PM
  5. Replies: 3
    Last Post: 01-24-2007, 10:08 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •