RE: Acrobat Scripting
RE: Acrobat Scripting
- Subject: RE: Acrobat Scripting
- From: "Wadson, David" <email@hidden>
- Date: Fri, 26 Apr 2002 13:58:40 -0400
My original approach to splitting PDF files was duplicating the original
file and deleting the pages I didn't want. Effective, but time consuming to
be duplicating files like that.
Then I went with a blank, single page PDF file, residing on a fileserver
(or where ever is convenient). I would duplicate that file, insert the page
I wanted into it, and then delete the extra blank page. That method works
but it's a nuisance having that blank file that you need to keep track of in
case it gets moved or deleted, etc.
My latest approach, which I've used to create generic placeholder TIFF files
to place in Quark documents, has the script creating a PDF file. By opening
up the PDF in a text editor, such as BBEdit, you can copy the source code
and place that into a property/variable in the script:
property blankPdfFileData : ""long, convoluted, 111 lines of PDF code go
here>"
Then, using the write commands in Standard Additions, you can create the PDF
file:
tell application "Finder"
set currentPdfBlank to open for access file currentPdfDestination with write
permission
write blankPdfFileData to currentPdfBlank
close access currentPdfBlank
set file type of file currentPdfDestination to "PDF "
set creator type of currentPdfDestination to "CARO"
end tell
I'm sure you'll realize if you try to run that as-is that it's not a
complete script. :-)
The only thing I don't like about this method is that the PDF data takes of
111 lines in the script. A really pain to be scrolling over while writing,
testing, and rewriting the script. But the convenience of the script being
totally portable makes up for that...once I done coding!
I've also done some automation of exporting EPS files from PDFs using
Prefab Player to handle the unscriptable parts (i.e. most of it). I've
tinkered with Acrobat 5 a bit which has greatly improved (i.e. added) the
export capabilities. Only thing I wasn't impressed with is that it doesn't
give you much control over the specific options. Instead of letting you set
them, it just uses the default settings. That's fine in a perfect world
where things never get monkeyed with...
My only other scripting with Acrobat has been the reverse - taking multiple
PDF files and merging them into one document. We use that for taking
invdividual pages of our newspaper that are finished at various times of the
evening, and then merge them into one complete document at the end. Nothing
really fancy about it with Acrobat - mostly some fancy filename scripting to
merge the files together in the proper order when they are named in section
order (A1, A2, A3,A4,B1,B2,B3,B4,C1,C2,C3,C4,C5,C6, etc.).
Haven't bothered getting into much else with Acrobat (yet). PDF is basically
the end-of-the-line for most of what we do. While we've started archiving
our entire newspaper into PDF form, we haven't really done anything with it
yet (cataloging, hotlinks, articles, bookmarks, etc.) yet so I haven't had
need to get into that. The only idea that management has had so far is to
compile a year-end compilation of the front pages of the paper as a
year-in-review CD that could be sold to the public. Good thing I know
AppleScript otherwise someone would sitting at a computer manually
extracting each page from almost 365 pdf files on 52 CDs at the end of the
year...
David Wadson
Coordinator of Graphic Services
The Chronicle-Journal
>
----------
>
From: email@hidden
>
Sent: Friday, April 26, 2002 12:29 PM
>
To: email@hidden
>
Subject: Re: Acrobat Scripting
>
>
>Offhand, is it possible to create a new PDF document from within a
>
script?
>
Not anywhere that I can find.
>
It appears that Acrobat is not in the document "creation" business, but
>
simply allows you to open and quasi-edit PDF files generated by the
>
distiller app or the PDF driver from another app.
>
I am no expert on scripting Acrobat whatsoever, but I did manage to set up
>
a
>
folder action that leverages "batch processing", saving PDFs as JPEG
>
files.
>
On multipage PDFs it will save each page individually. You might be able
>
to
>
programmatically break the document into it's individual pages and
>
immediately delete all but the page you were after. Let me know if you are
>
interested and maybe we can exchange code, I'd love to see other's work on
>
cracking the Acrobat scripting conundrum.
>
Kev
>
--
>
Kevin Talbert
>
L2 Support, Macintosh
>
(501)376.5226
>
_______________________________________________
>
applescript-users mailing list | email@hidden
>
Help/Unsubscribe/Archives:
>
http://www.lists.apple.com/mailman/listinfo/applescript-users
>
Do not post admin requests to the list. They will be ignored.
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.