Author Topic: 76page PDF needs splitting into 38 two page PDFs  (Read 3244 times)

0 Members and 1 Guest are viewing this topic.

Offline Glenn

  • Full Member
  • ***
  • Posts: 139
  • Karma: 4
  • Gender: Male
76page PDF needs splitting into 38 two page PDFs
« on: September 11, 2009, 05:31:42 PM »
not sure if i need a script to achieve this but you resident geniuses will know whats possible or if there is another way.

I don't have a clue about applescript,  apart from using a couple that Larsen67 has sent me for quark or I've downloaded for InDesign, so I'm probably after really basic instructions of how to implement it too. I don't recall seeing an applescript icon in the Acrobat toolbar.

I need to split out page1&2 as the first pdf then page3&4 as the second pdf and so on.

I'm using Acrobat7 Professional on OSX10.4.11 (but Acrobat8 Professional is available to me on 10.4.11 or Acrobat Pro 9 on 10.5.7)

Offline Jean-Marie Schwartz

  • Sr. Member
  • ****
  • Posts: 436
  • Karma: 6
  • Gender: Male
Re: 76page PDF needs splitting into 38 two page PDFs
« Reply #1 on: September 14, 2009, 02:57:17 AM »
Hi!
If the file you have shows really as 1 single page for pages 1 & 2, what you could do is manually to crop every page, save the resulting pages as say Odd_pages, then Apple-Z to recover the original PDF and crop again the other side so you get every even pages. Then gather both of them. Are you with me?
Jean-Marie Schwartz
May the Schwartz be with you :-)

= Mac Pro Quad-Core Intel 2.8 GHz • 10 Go 1066 MHz DDR3 • Mac OS 10.8.5 • QuarkXPress 9.5.4.1 • Adobe CS5 =

Offline larsen67

  • Sr. Member
  • ****
  • Posts: 459
  • Karma: 10
  • Gender: Male
Re: 76page PDF needs splitting into 38 two page PDFs
« Reply #2 on: September 14, 2009, 06:25:27 AM »
Glenn, you could try this?

001   property Default_Path : (path to desktop folder as Unicode text) as alias
002   property JavaScript : "var re = /.*\\/|\\.pdf$/ig; var filename = this.path.replace(re,''); try { for (var i = 0; i < this.numPages;  i = i + 2) this.extractPages( { nStart: i,  nEnd: ( i + 1 ), cPath: filename+'_' + ( i + 1 )  + '-' + ( i + 2 ) +'.pdf' }); } catch (e) { console.println('Aborted: '+e) }"
003   --
004   set The_PDF to choose file default location Default_Path ¬
005        with prompt "Where is the multi-page PDF?" without invisibles
006   --
007   tell application "Adobe Acrobat 7.0 Professional"
008        activate
009        open The_PDF
010        tell active doc
011             with timeout of 300 seconds
012                  do script JavaScript
013             end timeout
014             close saving no
015        end tell
016   end tell

Offline Glenn

  • Full Member
  • ***
  • Posts: 139
  • Karma: 4
  • Gender: Male
Re: 76page PDF needs splitting into 38 two page PDFs
« Reply #3 on: October 01, 2009, 12:05:43 PM »
Sorry to be away for so long. Thanks for trying to help.

Hi Jean-Marie
I'm afraid I'm not with you, have you been on that virtual Belgian Beer again ;D
I just needed 38 individual pdfs, each with 2 pages.
I start with 38 pdfs each 2 pages. My RIP turns these into 76 individual pdfs (38 fronts and 38 backs) and can quickly combine into one PDF containing 76 pages. When its just one file I need to do a whole bunch of global amends but then need to split it out back into twos again because the client can't use ftp and has a small email limit.

Hi larsen
Ok for dummies like me how do i turn your text into a script and try it.

Offline larsen67

  • Sr. Member
  • ****
  • Posts: 459
  • Karma: 10
  • Gender: Male
Re: 76page PDF needs splitting into 38 two page PDFs
« Reply #4 on: October 01, 2009, 02:09:48 PM »
Locate 'Script Editor' this app should by default be in Apps/AppleScript launch it then C&P the 16 lines of code into the new doc window. Then remove the first 3 digits of each line of code once done click the 'compile' button at the top if you don't have "Adobe Acrobat 7.0 Professional" it will ask for you to locate an alternative app so navigate/pick what you have installed Versions 6,7,8,9 of PRO should be able to run this. Once the code is compiled you can just save it as a script file to pretty much where you want. You should just be able to run it directly from within 'Script Editor' The spreads will be saved to the same location as the file you choose when prompted. You may need to turn on 'Enable Acrobat JavaScript' first NOT sure on that. Hope it works OK 4U.

Offline Jean-Marie Schwartz

  • Sr. Member
  • ****
  • Posts: 436
  • Karma: 6
  • Gender: Male
Re: 76page PDF needs splitting into 38 two page PDFs
« Reply #5 on: October 02, 2009, 03:04:11 AM »
Hi Jean-Marie
I'm afraid I'm not with you, have you been on that virtual Belgian Beer again ;D
I just needed 38 individual pdfs, each with 2 pages.
I start with 38 pdfs each 2 pages. My RIP turns these into 76 individual pdfs (38 fronts and 38 backs) and can quickly combine into one PDF containing 76 pages. When its just one file I need to do a whole bunch of global amends but then need to split it out back into twos again because the client can't use ftp and has a small email limit.

OK. What you said was: "I need to split out page1&2 as the first pdf then page3&4 as the second pdf and so on."
So what I got was: you have 1-page PDFs with spreads (page 1-2, 3-4, and so on) and you want 1-page PDFs with single pages (page 1, 2, 3, 4 and so on).
So my answer was to crop your PDFs.
But it appears your starting PDFs were actually 2 separate pages. The problem is different. Sorry.

BTW my personal picture was showing chocolate, not beer. I've changed it to the World Beer Awards 09 won by Blanche de Namur last summer. :-)
Jean-Marie Schwartz
May the Schwartz be with you :-)

= Mac Pro Quad-Core Intel 2.8 GHz • 10 Go 1066 MHz DDR3 • Mac OS 10.8.5 • QuarkXPress 9.5.4.1 • Adobe CS5 =

Offline Glenn

  • Full Member
  • ***
  • Posts: 139
  • Karma: 4
  • Gender: Male
Re: 76page PDF needs splitting into 38 two page PDFs
« Reply #6 on: October 02, 2009, 03:13:10 AM »
 ;D
larsen
the script works perfectly, it took a few minutes rather than the 4hrs I'd spent doing it all manually back in September.
If I needed to adapt it from 2 pages to 4 pages would this be right?

002   property JavaScript : "var re = /.*\\/|\\.pdf$/ig; var filename = this.path.replace(re,''); try { for (var i = 0; i < this.numPages;  i = i + 4) this.extractPages( { nStart: i,  nEnd: ( i + 3 ), cPath: filename+'_' + ( i + 1 )  + '-' + ( i + 4 ) +'.pdf' }); } catch (e) { console.println('Aborted: '+e) }"

Offline Glenn

  • Full Member
  • ***
  • Posts: 139
  • Karma: 4
  • Gender: Male
Re: 76page PDF needs splitting into 38 two page PDFs
« Reply #7 on: October 02, 2009, 03:26:02 AM »
Jean-Marie, its difficult enough to understand what I type sometimes when English is your native tongue, no need to apologise.

do they Export any of that Namur beer to the UK? My personal favourite at the moment is Summer Lightning which you can get in a few pubs in Wiltshire.

http://www.hopback.co.uk/real-ale-online/index.php?cPath=3

Offline Jean-Marie Schwartz

  • Sr. Member
  • ****
  • Posts: 436
  • Karma: 6
  • Gender: Male
Re: 76page PDF needs splitting into 38 two page PDFs
« Reply #8 on: October 02, 2009, 04:04:17 AM »
I think Michel should definately open a new category here called Beers.  :D
And grant us once or twice a year a ticket to gather somewhere in Belgium or UK to share "our" products…  8)
This mean the Forum would accept commercials to earn money  :-\
Jean-Marie Schwartz
May the Schwartz be with you :-)

= Mac Pro Quad-Core Intel 2.8 GHz • 10 Go 1066 MHz DDR3 • Mac OS 10.8.5 • QuarkXPress 9.5.4.1 • Adobe CS5 =

Offline larsen67

  • Sr. Member
  • ****
  • Posts: 459
  • Karma: 10
  • Gender: Male
Re: 76page PDF needs splitting into 38 two page PDFs
« Reply #9 on: October 02, 2009, 04:05:00 AM »
Glenn, that looks good to me we'll make a coder of you yet… Here is the other one that I use a lot which is of cause to single pages.

"var re = /.*\\/|\\.pdf$/ig; var filename = this.path.replace(re,''); try { for (var i = 0; i < this.numPages; i++) this.extractPages( { nStart: i, cPath: filename+'_' + ( i + 1 ) +'.pdf' }); } catch (e) { console.println('Aborted: '+e) }"

Now if you go to 'AppleScript Utility' in the same folder of your app's launch and go to the option and check 'Show Script in menu bar. You should then have a script icon up by the date (top right) Go to 'Open Scripts Folder - Open Library Scripts Folder' here you can make a folder for 'Acrobat' and save your scripts to this. From there on you should just be able to run from this menu. Ditto for any other AppleScripts you may want to use. Lots of apps have a built in options for running scripts but Acrobat only has the JavaScript console.