Re: Cropping pdf in ACROBAT
Re: Cropping pdf in ACROBAT
- Subject: Re: Cropping pdf in ACROBAT
- From: Emmanuel Lévy <email@hidden>
- Date: Sun, 25 Dec 2016 13:47:32 +0100
Why not using Smile ? It’s fairly scriptable.
Tell me if you need help.
Emmanuel
> On 24 Dec 2016, at 21:41, Brian Christmas <email@hidden> wrote:
>
> Thanks Shane
>
> Got up early on Christmas morning to prepare my wife's present (new iPad 2), So checking my eMail.
>
> I kept researching after I posted, and found the same thing. Crop does not erase extra images in Acrobat. There IS a way to remove the extra, but Acrobat won’t respond to scripts addressing its menus, and the method also uses graphical interfaces.
>
> So, I maunally tried saving as a tiff, then re-opened the saved file with Acrobat. It opened as a .pdf.
>
> Ir worked!! TRIMMED OFF THE EXCESS!
>
> However, when I tried to do the same thing with code, it would not save. ‘Save’ cannnot understand, etc.
>
> I used your excellent saving procedure for Sierra, but the compiler for Acrobat changed a critical word, from ’to', to ‘of’.
>
> Can’t find a way around it, so wondered if using the same line as a shell script would work. I researched, but can’t find out how to actuallty wrirte such as script. Lots of warnings about different types of scripting, and lots on how to save text, etc, but nothing describing my situation. The MAN pages just left me baffled.
>
> Any advice please on a suitable shell script? No hurry. Enjoy Christmas, and have a Merry one.
>
> Regards
>
> Santa
>
>
> set theItem to ((path to desktop as text) & "AuburnAlumni LifetimeAchievement LARGE DIE LINE 121616_104500.pdf") as text
> tell application "Adobe Acrobat"
> activate
> open file theItem
> end tell
>
> set theitem2 to "AuburnAlumni LifetimeAchievement LARGE DIE LINE 121616_104500.tiff" as text
>
> set pathToFile to ((path to desktop as text) & theitem2) as text
> set theFile to pathToFile as «class furl»
> set fileRef to open for access theFile with write permission
> close access fileRef
> do shell script ("sleep 0.4")
> tell application "Adobe Acrobat"
> activate
> say (count of pages of document 1)
>
> tell page 1 of document 1
> save of theFile
> end tell
> close every document saving no
> open theFile
> end tell
>
>
>
>> On 24 Dec 2016, at 10:36 pm, Shane Stanley <email@hidden> wrote:
>>
>> On 24 Dec 2016, at 10:04 am, Brian Christmas <email@hidden> wrote:
>>>
>>> I need a way, using Xcode ASObjC, to crop the image before expanding it
>>
>> You're not going to find it. The sort of "cropping" you can do with PDFs isn't real cropping -- it's just setting the area that appears.
>>
>> I suppose you could try masking out the area outside the crop box with empty text boxes or something, but that's pretty ugly. Or turn the PDF into a bitmap.
>>
>> --
>> Shane Stanley <email@hidden>
>> <www.macosxautomation.com/applescript/apps/>, <latenightsw.com>
>>
>>
>>
>> _______________________________________________
>> Do not post admin requests to the list. They will be ignored.
>> AppleScript-Users mailing list (email@hidden)
>> Help/Unsubscribe/Update your Subscription:
>> Archives: http://lists.apple.com/archives/applescript-users
>>
>> This email sent to email@hidden
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> AppleScript-Users mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
> Archives: http://lists.apple.com/archives/applescript-users
>
> This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden