Cut a merged document in several PDFs

After working on a project for Numbers, I applied the same scheme to Pages.
Assuming that you are merging datas from Numbers or AddressBook in a Pages Layout document, here is a script allowing you to print a PDF for each correspondent.
It may be done because we may
delete unwanted sections
keep only one
save it in a PDF
and repeat the task for an other section.
Here is the script:
--[SCRIPT 4mergedLayout]
Enregistrer le script en tant que Script : 4mergedLayout.scpt
déplacer le fichier ainsi créé dans le dossier
<VolumeDeDémarrage>:Users:<votreCompte>:Library:Scripts:Applications:Pages:
Il vous faudra peut-être créer le dossier Pages et peut-être même le dossier Applications.
Ouvrir le document Mise en pages résultant d'une fusion de données
menu Scripts > Pages > 4mergedLayout
crée un fichier PDF pour chaque section du document.
--=====
L'aide du Finder explique:
L'Utilitaire AppleScript permet d'activer le Menu des scripts :
Ouvrez l'Utilitaire AppleScript situé dans le dossier Applications/AppleScript.
Cochez la case "Afficher le menu des scripts dans la barre de menus".
--=====
Save the script as a Script: 4mergedLayout.scpt
Move the newly created file into the folder:
<startup Volume>:Users:<yourAccount>:Library:Scripts:Applications:Pages:
Maybe you would have to create the folder Pages and even the folder Applications by yourself.
Open the Layout document build by a Merge session.
menu Scripts > Pages > 4mergedLayout
create a PDF for every embedded section.
--=====
The Finder's Help explains:
To make the Script menu appear:
Open the AppleScript utility located in Applications/AppleScript.
Select the "Show Script Menu in menu bar" checkbox.
--=====
Yvan KOENIG (VALLAURIS, France)
2010/05/11
--=====
Some global constants
property targetFolderName : "Merged pages or sections"
property folderOnDesktop : true
true = stores the PDFs in a folder on the Desktop
false = stores the PDFs in a subfolder of the Documents folder
property useDateStamp : false
true = inserts a dateTimeStamp in the names of PDFs
false = doesn't insert a dateTimeStamp in the names of PDFs
--=====
on run
tell application "Pages"
set dName to name of document 1
tell document 1
set maybe to (get body text) is missing value
end tell
end tell -- Pages
if not maybe then
if my parleAnglais() then
error "The document “" & dName & "” is not a Layout one !"
else
error "“" & dName & "” n’est pas un document Mise en page !"
end if -- parleAnglais…
end if -- not maybe…
Build some constants
(1) Prepare a folder to store the PDF reports
if folderOnDesktop then
set p2d to path to desktop folder as text
else
set p2d to path to documents folder as text
end if
set targetFolder to p2d & targetFolderName & ":"
tell application "System Events"
if not (exists folder targetFolder) then make new folder at end of folder p2d with properties {name:targetFolderName}
end tell -- System Events
(2) Grabs the path to the source spreadsheet
tell application "Pages" to set thePath to path of document dName (* an Unix path *)
tell application "System Events" to set thePath to (path of disk item thePath) as text
(3) Build the name and the path of the temporary Pages document
set tempFolderHFS to path to temporary items
set tempDoc to (tempFolderHFS as text) & dName
tell application "System Events"
if exists disk item tempDoc then delete disk item tempDoc
end tell
tell application "Pages" to tell document dName
set nbSections to count of sections
end tell -- Pages
* Here we enter the main loop
repeat with i from 1 to nbSections
set sectionID to i
Grabs datas to build the name of the PDF then
save the document with the temporary sheet in the temporary folder
tell application "System Events" to make new file at end of tempFolderHFS with properties {name:dName}
set fullName to dName & "_section#" & text -5 thru -1 of ("00000" & sectionID)
tell application "Pages"
save document dName in (tempDoc as alias)
end tell -- Pages
Now, the displayed document is the one stored in the temporary items folder.
Builds the name and the pathname of the student's PDF.
if useDateStamp then
set pdfName to fullName & my dateTimeStamp() & ".pdf"
else
set pdfName to fullName & ".pdf"
end if -- useDateStamp
set pdfPath to targetFolder & pdfName
Create the PDF file
tell application "System Events" to make new file at end of folder targetFolder with properties {name:pdfName}
tell application "Pages"
tell document dName
if sectionID < nbSections then
repeat with s from nbSections to (sectionID + 1) by -1
delete section s
end repeat
end if
if sectionID > 1 then
repeat with s from 1 to (sectionID - 1)
delete section s
end repeat
end if
end tell -- temporary document
save document dName as "SLDocumentTypePDF" in (pdfPath as alias)
close document dName without saving
end tell -- Pages
tell application "System Events" to delete disk item tempDoc
tell application "Pages"
open (thePath as alias)
repeat until exists document dName
delay 0.2
end repeat
end tell -- Pages
end repeat -- for next section
end run
--=====
on parleAnglais()
local z
try
tell application "Pages" to set z to localized string "Cancel"
on error
set z to "Cancel"
end try
return (z is not "Annuler")
end parleAnglais
--=====
on dateTimeStamp()
return (do shell script "date +_%Y%m%d-%H%M%S")
end dateTimeStamp
--=====
--[/SCRIPT]
A property allow you to choose to store the PDFs in a folder on the Desktop
or in a subfolder of your Documents folder.
An other property allow you to insert a dateTime stamp in the PDFs names.
Yvan KOENIG (VALLAURIS, France) mardi 11 mai 2010 18:24:44

JavaWorld online magazine published a series of topic regarding Printing in Java. Go to check then out.

Similar Messages

  • How do I convert mail merge documents to individual pdf docs and save each with a field in the merge?

    How do I convert mail merge documents to individual pdf docs and save each with a field in the merge?

    Is this an actual field, or just some piece of static text somewhere? Either way, you can't do it using the Split Document command. You'll need to use a custom-made script to read the value of this "field" and use it when extracting pages from the file.

  • Merging documents into one PDF

    Hi,
      I am trying to merge multiple files (MS Word, MS Excel) into one PDF document using ADS.
      I saw a sample progam FP_PDF_TEST_19 which says * Merge data from a file in an existing PDF. I am trying similar to that.
      I checked the ADS connection/configuration and seems to be correct. To confirm that I executed the programs FP_PDF_TEST_00 & FP_TEST_00..It is showing version number and PDF form accordingly.
    When I run the program FP_PDF_TEST_19..I am getting the following exception..
    System Error: com.adobe.ProcessingException: PDF is not interactive: Data can only be imported into interactive forms.
    Processing exception during a "MergeData" operation.
      My Question is it possible to merge multiple documents and if possible is there any configuration I am missing.
      Please let me know if you require more details.
    Thanks
    Naren
    Edited by: Narendran Muthukumaran on Oct 23, 2008 9:49 PM

    Hi,
    First of all, "merging" document while using ADS consist of adding attachement to ypur form, you can really mere several document into one .
    For merging document you have to give a PDF file for input and the document you want to add ( Excel, Word ... ) . The PDF document must be known by the system that means you must have define a form while using transaction SFP . If it's not the case the system can't make the merge .
    Hope this help you
    Regards

  • Splitting an Illustrator document on several pdf-Files including cutting marks

    Hello, I am new to the CC version and I wondered if it is possible to automatically split a bigger Illustrator document to smaller (printable) pdf files.
    Right now i am having this kind of workflow:
    Drawing on a big sheet - e.g. A1
    Inserting "frames" size 18 x 26 cm in en extra layer
    inserting "Glue here" marks with numbers, which then are supposed to be glued together when printed
    cutting all lines on frame edges (This is still an issue for me in Illustrator CC - it worked with CS5 much better - there it was automatically snapping to the intersection point - got anybody also help for that??? )
    copying each single frame and its content onto a new A4 document
    exporting as png
    inserting the pages into word, creating a pdf file
    as you see - this process ist pretty long and time consuming, and no - I CAN'T just get it with my printer, because I wand that exact cutter marks in my pdf document.
    Is there any way I could possibly automate that process - at least to some extent?
    greetings
    Sophie

    so how do I do that?
    I mean i just have one canvas i drew on, not a multipage ai file

  • Need help fast! Need site to merge documents into one pdf

    I pay a monthly fee to adobe so I can merge different files together into one pdf. I just logged in for the first time this semester, and all I see are different products adobe wants me to buy. How do I find the site to merge the documents? I have less than 3 hours till I have to submit, please help!

    If you subscribed to PDF Pack, go to http://createpdf.adobe.com/
    If you subscribed to Acrobat Pro, download and install it.
    If you subscribed to Acrobat Plus, do either.
    Otherwise you probably have the wrong subscription.

  • Cannot merge several PDF-documents

    Hello dear adobe,
    I've had a rough time trying to figure this out. The scenario is the following:
    I'm the IT-guy within a huge company. Today I recieved a computer and a annoyed user complaining about our adobe acrobat standard 9. It seems like most of the people in the building can't merge several pdf's to one. These "selected few" do have the same version of acrobat as everyone else.
    The errormessage given is:
    "No PDF file was created because acrobat encountered an unidentified error."
    I have tried to move the files to be both on the network, and local. I've tried to move it to a location with a short pathway (\\server\share\adobefileX). I've tried to rename them to shorter names without spaces or any special letters.
    I have even tried to reinstall acrobat, without any results.
    Could this be due to a setting at each individual computer? Or could it be security policies/settings preventing acrobat to work fully?
    Do you know anything that can cause this on a corperate network? I'm willing to test most things, since this problem concerns alot of people.
    Thanks!
    /Simon

    Hello eorilly5,
    Thank you for using Apple Support Communities!
    It sounds like you are unable to print from anything from your printer.
    I would recommend these troublehsooting steps from the article named Troubleshooting printer issues in OS X found here http://support.apple.com/kb/TS3147.
    Make sure that the printer is powered on, has ink / toner, and that there are no alerts on the printer’s control panel. Note: If you cannot clear an alert on the printer's control panel, stop here and check the printer's documentation or contact the manufacturer for support.
    Ensure the printer is properly connected to a USB port on the Mac or AirPort base station / Time Capsule. If the printer is a network-capable printer, make sure that it is properly connected to your home network.
    Use Software Update to find and install the latest available updates. If an update is installed, see if the issue persists.
    Open the Print & Scan pane or Print & Fax (Snow Leopard) pane in System Preferences.
    Delete the affected printer, then add the printer again.
    If the issue persists, try these additional steps:
    Reset the printing system, then add the printer again.
    If the issue still persists, reset the printing system again.  Download and install your printer's drivers. Then, add the printer again.
    Contact the printer vendor or visit their website for further assistance.
    All the very best,
    Sterling

  • I have a paid subscription, but am no longer able to merger multiple pdf documents into one pdf. What's up?

    I have a paid subscription, but am no longer able to merger multiple pdf documents into one pdf. What's up?

    Pat:
    Below is a copy of an 8/7/2013 email from adobe. I prepaid a one-year subscription, and, until I recently upgraded to Windows 8, I was able to make several dozens of merged pdf documents. I seem to be no longer able to use the merge feature that I had successfully and repeated used. When I search for the merge feature I end up with a request that I pay for an upgrade monthly subscription to use the merge feature.
    Tom
    =================================here follows my subscription email====================================================
    Welcome to Adobe ExportPDF
    2 messages
    [email protected] <[email protected]>
    Wed, Aug 7, 2013 at 1:01 PM
    Reply-To: [email protected]
    To: [email protected]
    Dear Thomas Corr,
    Thank you for purchasing a subscription for Adobe ExportPDF.
    Sign-in to export a PDF Now >>
    With your subscription you can:
    Enjoy unlimited online conversions from PDF to Word (DOCX).
    Make scanned text editable.
    Maintain page, paragraph, and font attributes.
    Preserve tables, images, and multi-column text.
    Export PDF comments to Word.
    Help and feedback
    Get help from Adobe on the Support Center.
    The Adobe ExportPDF Team

  • Open several PDFs in the same Reader window using tabs for each document

    How do I open several PDFs in the same Reader window using tabs for each document?  I'm using Reader 11.0.03 and Windows 7.  

    That would be a nice feature!  Suggest it at https://www.adobe.com/cfusion/mmform/index.cfm?name=wishform - hopefully it will make it into Reader XII.

  • How do I merge more than one PDF document into one singular pdf using adobe viewer touch on a microsoft surface?

    How do I merge more than one PDF document into one singular pdf using adobe viewer touch on a microsoft surface?

    Or using the Adobe PDF Pack https://www.acrobat.com/

  • I created several pdfs & saved them in adobe acrobat pro.  I want to start all over & want to delete these pdfs so I am not confused with more than one document with similar titles.  How do I delete the document

    I am working on a big project & creating everything in word.  I then am turning the documents into PDF format so they will be easy for everyone to open.  I have several PDFs that are not the way I want them & want to delete them so I don't have so many documents with similar names.  Is there a way to delete a pdf from my saved document??  This is probably very simple & I am over thinking it, but appreciate any help.

    I was able to figure it out, & just as I thought way to simple!  UGH!

  • Trouble opening pdf's - I have received several pdf's from a friend via e-mail (Thunderbird). Some of them open just fine but others give me the message: "There was an error opening this document. The file is damaged and could not be repaired."

    Trouble opening pdf's - I have received several pdf's from a friend via e-mail (Thunderbird). Some of them open just fine but others give me the message: "There was an error opening this document. The file is damaged and could not be repaired." My friend made sure that the files in question opened without issue on his computer (a PC). Further, I was able to open one of these "damaged" files on my Android phone, but I cannot open them on the Macbook Air. Any help would be greatly appreciated.

    Back up all data.
    Triple-click the line of text below to select it, the copy the selected text to the Clipboard (command-C):
    /Library/Internet Plug-ins
    In the Finder, select
    Go ▹ Go to Folder
    from the menu bar, or press the key combination shift-command-G. Paste into the text box that opens (command-V), then press return.
    From the folder that opens, remove any items that have the letters “PDF” in the name. You may be prompted for your login password. Then quit and relaunch Safari, and test.
    The "Silverlight" web plugin distributed by Microsoft can also interfere with PDF display in Safari, so you may need to remove it as well, if it's present.
    If you still have the issue, repeat with this line:
    ~/Library/Internet Plug-ins
    If you don’t like the results of this procedure, restore the items from the backup you made before you started. Relaunch Safari again.

  • I have several pdfs on my iPad in iBooks. My iPhone shows only the categories, none of the documents. How can I get my iPhone to also show the documents that are on my iPad?

    I have several pdfs on my iPad in iBooks. My iPhone shows only the categories, none of the documents. How can I get my iPhone to also show the documents that are on my iPad?

    You will need to connect your iPad to your computer's iTunes and do File > Devices > Transfer Purchases to copy them over to your computer (that will copy PDFs and epubs that are in the iBooks app, not just actual ibooks), and you can then sync them to your iPhone. Or you might be able to open each PDF in iBooks on your iPad and use the share icon to email them to yourself and then use 'open in' in the Mail app on your iPhone to copy them to its iBooks app (if the PDF is protected then you may not get the email option via the share icon).
    The Settings > iBooks > Sync Collections setting doesn't copy items between devices, it just means that it a bookor PDF is on both devices and you move it into a collection on one device then it will be moved into the same collection on the other device

  • How do I combine several pdfs into one document?

    I just switched to Yosemite, and now I cannot figure out how to combine several pdfs into one document. I rarely need to do this, so I looked at past tutorials, but nothing seems to work. Help!

    I don't understand - I've just tried it and it worked. I had 2 multi-page pdfs, opened both in Preview, followed my earlier post and saved the new pdf. The saved file is multi-page
    Odd

  • How to include several PDF documents into just one file?

    I have a Word document with 6 pages that I saved in PDF.
    I wanted to transform the entire document in JPEG (JPG) immage, so that I could use it in other tools, such as Facebook for example.
    The problem is that using Adobe Photoshop it opens and saves page by page.
    Can you give me s solution or hint?
    Flavio
    [email protected]

    Thank you!
    I already saved all pages as .pdf w/ Acrobat and have all 6 pages saved in
    .jpg, using Photoshop.
    Problem is that I want to post the whole text in my Facebook page, and to
    have it in six pieces is not quite readable...
    Thanks anyway and have a joyful Xmas!
    2011/12/24 try67 <[email protected]>
       Re: How to include several PDF documents into just one file?  created
    by try67 <http://forums.adobe.com/people/try67> in Adobe Reader - View
    the full discussion <http://forums.adobe.com/message/4102594#4102594>

  • Merge Many PDF files in several PDF Files

    Hi,
    I have about 500 PDF Files :
    PDF_A1
    PDF_A2
    PDF_B1
    PDF_B2
    EtC.
    I want to Merge all my 500 PDF Files in 250 PDF files. I want to merge A1 with A2. B1 with B2 etc. Any idea to how to do ?
    Thank you

    Hi Dave,
    First, the issue does not exist anymore. We have decided to merge all documents in the same file. that's done and OK
    Then, Any way, I have found a solution:
    Use a script to put in different folders all files which must be together. I mean Folder A will contain files A1 and A2. Folder B will contain files B1 and B2 ...
    Then use a PDF software in command line to merge all PDF files folder by folder.
    Thnak you for your reply.

Maybe you are looking for