• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re[2]: Convert an image to a PDF
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re[2]: Convert an image to a PDF


  • Subject: Re[2]: Convert an image to a PDF
  • From: Leonid Bogdanov <email@hidden>
  • Date: Sat, 28 May 2011 21:59:31 +0400

Michelle,

  Thank you for your snippet, but AFAIK, Image Events scripting app is built on top of sips, so I think the result will be the same
  as calling it directly. But I'll try :)

Best regards,
Leonid Bogdanov.


Fri, 27 May 2011 13:51:02 -0700 letter from Michelle Steiner <email@hidden>:

On May 27, 2011, at 1:28 PM, Leonid Bogdanov wrote:

What is the best way of lossless conversion of an image (JPEG, PNG or BMP) to a PDF file from AppleScript?
 I tried to call sips, but it compresses an image being processed, so small images have poor quality in resulting PDFs.
 I tried to use cupsfilter, but it generates the resulting PDF in paper size (e.g. A4) and not of size equal to input image.

 I'll appreciate any suggestions of parameters for these tools to improve output or suggestions of another techniques.

Here's a script that I use; I don't know whether it compresses the image or not.  So far as I know, all PDFs are saved at a paper size.

-- Michelle

set theImage to choose file with prompt "Choose the file you wish to convert." of type "public.png" without invisibles
tell application "Finder"
set the file_path to the container of theImage as alias as string
set the Ext_hidden to the extension hidden of theImage
set the extension hidden of theImage to true
set the destination to (the container of theImage as alias as string) & the displayed name of theImage & ".pdf"
set the extension hidden of theImage to Ext_hidden
end tell

tell application "Image Events"
launch
set the ImageRef to open theImage
save the ImageRef in destination as PDF
close theImage
end tell

--
"Democrats wrap themselves in the constitution and burn the flag while Republicans wrap themselves in the flag and burn the constitution."


_______________________________________________
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

References: 
 >Convert an image to a PDF (From: Leonid Bogdanov <email@hidden>)
 >Re: Convert an image to a PDF (From: Michelle Steiner <email@hidden>)

  • Prev by Date: Re: Load Script
  • Next by Date: Re[2]: Convert an image to a PDF
  • Previous by thread: Re: Convert an image to a PDF
  • Next by thread: Re: Convert an image to a PDF
  • Index(es):
    • Date
    • Thread