• 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: Print to PDF
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Print to PDF


  • Subject: Re: Print to PDF
  • From: email@hidden
  • Date: Tue, 10 Jan 2012 09:46:50 -0500

If you can output a postscript file from your app, try using pstopdf:

    do shell script "pstopdf " & [thePostscriptFileName] & " -o " & [thePDFname]

It's pretty quick and handy. I use this all the time to make PDFs of basic text input (piped from stdin using enscript).  --Stefan



* * * * * * *

Stefan Economou
Creative Operations Director
Communications
(617) 760-8089





From: email@hidden
To: email@hidden
Date: 01/09/2012 09:38 PM
Subject: AppleScript-Users Digest, Vol 9, Issue 9
Sent by: applescript-users-bounces+stefan_economou=email@hidden





Send AppleScript-Users mailing list submissions to
                email@hidden

To subscribe or unsubscribe via the World Wide Web, visit
               
http://lists.apple.com/mailman/listinfo/applescript-users
or, via email, send a message with subject or body 'help' to
                email@hidden

You can reach the person managing the list at
                email@hidden

When replying, please edit your Subject line so it is more specific
than "Re: Contents of AppleScript-Users digest..."


Today's Topics:

  1. Print to PDF (R. Nelson Byrne)
  2. Re: Print to PDF (Luther Fuller)
  3. Re: Print to PDF (Mike Matthews)
  4. Re: Print to PDF (Bill Cheeseman)
  5. Re: Print to PDF (email@hidden)
  6. Re: Print to PDF (Alex Zavatone)
  7. Re: Print to PDF (Rick Gordon)
  8. Re: Print to PDF (Joe)


----------------------------------------------------------------------

Message: 1
Date: Mon, 09 Jan 2012 13:48:33 -0800
From: "R. Nelson Byrne" <email@hidden>
Subject: Print to PDF
To: email@hidden
Message-ID: <email@hidden>
Content-Type: text/plain; charset=us-ascii

Is there a way using AppleScript or Automator to print to PDF?

In the old days there was an Adobe program that emulated a printer, not quite the same thing and as far as I know no longer in service. One could effect a print to pdf by using it as the printer name in print settings, as I recall.

TIA,


Nelson Byrne

------------------------------

Message: 2
Date: Mon, 09 Jan 2012 16:18:21 -0600
From: Luther Fuller <email@hidden>
Subject: Re: Print to PDF
To: Applescript Users <email@hidden>
Message-ID: <email@hidden>
Content-Type: text/plain; charset="us-ascii"

On Jan 9, 2012, at 3:48 PM, R. Nelson Byrne wrote:

> Is there a way using AppleScript or Automator to print to PDF?

I use this:  
http://www.macupdate.com/app/mac/20219/cups-pdf
to save message files via Mail which contain images.

> In the old days there was an Adobe program that emulated a printer, not quite the same thing and as far as I know no longer in service. One could effect a print to pdf by using it as the printer name in print settings, as I recall.


That's more or less how CUPS-PDF works. I have an AppleScript that creates the pdf documents and can provide help, if necessary.


-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://lists.apple.com/mailman/private/applescript-users/attachments/20120109/69d0dd35/attachment.html

------------------------------

Message: 3
Date: Mon, 09 Jan 2012 22:30:41 +0000
From: Mike Matthews <email@hidden>
Subject: Re: Print to PDF
To: AppleScript Users <email@hidden>
Message-ID: <email@hidden>
Content-Type: text/plain; charset="us-ascii"

On Jan 9, 2012, at 2:18 PM, Luther Fuller wrote:

On Jan 9, 2012, at 3:48 PM, R. Nelson Byrne wrote:

Is there a way using AppleScript or Automator to print to PDF?

I use this:  
http://www.macupdate.com/app/mac/20219/cups-pdf
to save message files via Mail which contain images.

In the old days there was an Adobe program that emulated a printer, not quite the same thing and as far as I know no longer in service. One could effect a print to pdf by using it as the printer name in print settings, as I recall.

That's more or less how CUPS-PDF works. I have an AppleScript that creates the pdf documents and can provide help, if necessary.

---
Can you post it?
---
Thanks,
mm

-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://lists.apple.com/mailman/private/applescript-users/attachments/20120109/19782ccb/attachment.html

------------------------------

Message: 4
Date: Mon, 09 Jan 2012 17:38:31 -0500
From: Bill Cheeseman <email@hidden>
Subject: Re: Print to PDF
To: AppleScript-Users Mail Mail <email@hidden>
Message-ID: <email@hidden>
Content-Type: text/plain; charset="windows-1252"

Every once in a while I like to show off what GUI Scripting can do.

Open a test window in TextEdit, then run this script:

activate application "TextEdit"
tell application "System Events"
                tell process "TextEdit"
                                 -- insert GUI Scripting statements here
                                 keystroke "p" using command down
                                 set PDFButton to menu button "PDF" of sheet 1 of window 1
                                 click PDFButton
                                 click menu item "Save As PDF…" of menu 1 of PDFButton
                                 delay 1
                                 click button "Save" of window 1
                end tell
end tell

The ellipsis in "Save as PDF..." is the ellipsis character, not three periods.

Filling in the Name field of the Save dialog is left as an exercise.

This runs on Mac OS X 10.7.2 Lion. I vaguely recall that I wrote a script just like this once before, so it probably works on earlier versions, too.


On Jan 9, 2012, at 4:48 PM, R. Nelson Byrne wrote:

> Is there a way using AppleScript or Automator to print to PDF?

--

Bill Cheeseman - email@hidden

-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://lists.apple.com/mailman/private/applescript-users/attachments/20120109/0f71d4b5/attachment.html

------------------------------

Message: 5
Date: Tue, 10 Jan 2012 00:37:58 +0000
From: email@hidden
Subject: Re: Print to PDF
To: "R. Nelson Byrne" <email@hidden>,
                applescript-users-bounces+zavpublic=email@hidden,
                email@hidden
Message-ID:
                <email@hiddenberry>
               
Content-Type: text/plain

Sure, I'll figure it out tonight.

Sent from my Verizon Wireless BlackBerry

-----Original Message-----
From: "R. Nelson Byrne" <email@hidden>
Sender: applescript-users-bounces+zavpublic=email@hidden
Date: Mon, 09 Jan 2012 13:48:33
To: <email@hidden>
Subject: Print to PDF

Is there a way using AppleScript or Automator to print to PDF?

In the old days there was an Adobe program that emulated a printer, not quite the same thing and as far as I know no longer in service. One could effect a print to pdf by using it as the printer name in print settings, as I recall.

TIA,


Nelson Byrne _______________________________________________
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

------------------------------

Message: 6
Date: Mon, 09 Jan 2012 19:09:28 -0600
From: Alex Zavatone <email@hidden>
Subject: Re: Print to PDF
To: email@hidden
Cc: applescript-users-bounces+zavpublic=email@hidden,                 "R.
                Nelson Byrne" <email@hidden>,
                email@hidden
Message-ID: <email@hidden>
Content-Type: text/plain; CHARSET=US-ASCII

Before I try to get started, what were you tying to print?

On Jan 9, 2012, at 6:37 PM, email@hidden wrote:

> Sure, I'll figure it out tonight.
>
> Sent from my Verizon Wireless BlackBerry
>
> -----Original Message-----
> From: "R. Nelson Byrne" <email@hidden>
> Sender: applescript-users-bounces+zavpublic=email@hidden
> Date: Mon, 09 Jan 2012 13:48:33
> To: <email@hidden>
> Subject: Print to PDF
>
> Is there a way using AppleScript or Automator to print to PDF?
>
> In the old days there was an Adobe program that emulated a printer, not quite the same thing and as far as I know no longer in service. One could effect a print to pdf by using it as the printer name in print settings, as I recall.



------------------------------

Message: 7
Date: Mon, 09 Jan 2012 17:13:48 -0800
From: Rick Gordon <email@hidden>
Subject: Re: Print to PDF
To: email@hidden
Message-ID: <p06240829cb3140c13241@[192.168.1.69]>
Content-Type: text/plain; charset=us-ascii

Is there any way to get CUPS-PDF to chose another location for the completed job files except for /private/var/spool/cups-pdf/<HOME> ?

--
___________________________________________________

RICK GORDON
EMERALD VALLEY GRAPHICS AND CONSULTING
___________________________________________________

WWW:  
http://www.shelterpub.com


------------------------------

Message: 8
Date: Mon, 09 Jan 2012 18:37:43 -0800
From: Joe <email@hidden>
Subject: Re: Print to PDF
To: Bill Cheeseman <email@hidden>
Cc: AppleScript-Users Mail Mail <email@hidden>
Message-ID: <email@hidden>
Content-Type: text/plain; charset="windows-1252"

On Jan 9, 2012, at 2:38 PM, Bill Cheeseman wrote:

> Every once in a while I like to show off what GUI Scripting can do.
>
> Open a test window in TextEdit, then run this script:
>
> activate application "TextEdit"
> tell application "System Events"
>                  tell process "TextEdit"
>                                   -- insert GUI Scripting statements here
>                                   keystroke "p" using command down
>                                   set PDFButton to menu button "PDF" of sheet 1 of window 1
>                                   click PDFButton
>                                   click menu item "Save As PDF…" of menu 1 of PDFButton
>                                   delay 1
>                                   click button "Save" of window 1
>                  end tell
> end tell
>
> The ellipsis in "Save as PDF..." is the ellipsis character, not three periods.
>
> Filling in the Name field of the Save dialog is left as an exercise.
>
> This runs on Mac OS X 10.7.2 Lion. I vaguely recall that I wrote a script just like this once before, so it probably works on earlier versions, too.


Thank you for that little gem Bill. It works in many applications, so I added a line to make it work from the Scripts menu and assigned it a hotkey with FastScripts.

Now I can generate a PDF from any application (that I've tested so far) that supports printing with a keystroke combo.

tell application "System Events"
                set appname to name of first process whose frontmost is true
end tell

activate application appname
tell application "System Events"
                tell process appname
                                 keystroke "p" using command down
                                 set PDFButton to menu button "PDF" of sheet 1 of window 1
                                 click PDFButton
                                 click menu item "Save As PDF…" of menu 1 of PDFButton
                                 delay 1
                                 click button "Save" of window 1
                end tell
end tell



Joe
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://lists.apple.com/mailman/private/applescript-users/attachments/20120109/0a5b0c88/attachment.html

------------------------------

_______________________________________________
AppleScript-Users mailing list
email@hidden
http://lists.apple.com/mailman/listinfo/applescript-users

End of AppleScript-Users Digest, Vol 9, Issue 9
***********************************************




This message is intended for the recipient only and is not meant to be forwarded or distributed in any other format. This communication is for informational purposes only. It is not intended as an offer or solicitation for the purchase or sale of any financial instrument, or security, or as an official confirmation of any transaction. Putnam does not accept purchase or redemptions of securities, instructions, or authorizations that are sent via e-mail. All market prices, data and other information are not warranted as to completeness or accuracy and are subject to change without notice. Any comments or statements made herein do not necessarily reflect those of Putnam Investments, LLC (DBA Putnam Investments) and its subsidiaries and affiliates. If you are not the intended recipient of this e-mail, please delete the e-mail.
 _______________________________________________
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

  • Prev by Date: Re: Print to PDF
  • Next by Date: Re: Print to PDF
  • Previous by thread: Re: Print to PDF
  • Next by thread: Re: Print to PDF
  • Index(es):
    • Date
    • Thread