How to create PDF files? Part II

Ken Ray kray at sonsothunder.com
Mon Mar 5 10:36:58 EST 2007


On Mon, 5 Mar 2007 15:27:45 +0000, Dave wrote:

> Hi Luis,
> 
> Yes, I'm on MacOS X. I looked at doing that, but it seems like a lot 
> of work and it is fairly fancy and so would need "pages" and I can't 
> guarantee that they will have this on their system. If I can't use 
> the Quartum library or something like it then I'll probably write my 
> own External Command Module that uses the Apple PDF Development Kit, 
> (you never know I might even be able to sell it separately!!). I'm 
> going to leave it for a bit and if I don't hear anything I'll have to 
> cancel the demo!

If they're plain text files (might even work with RTF), you can pipe it 
to the 'convert' application in the shell on OS X:

function stsMakePDF pSrcPath,pDestPath
  switch (the platform)
  case "MacOS"
    if isOSX() then
      set the cursor to watch
      put "/System/Library/Printers/Libraries/convert" into tConvertApp
      get shell(tConvertApp && "-f" && q(pSrcPath) && "-o" && 
q(pDestPath) && "-j application/pdf")
      if it = "" then
        return "OK"
      else
        return "Error : " & it
      end if
    else
      return "Error : stsMakePDF only works on Mac OS X."
    end if
    break
  default
    return "Error : stsMakePDF only works on Mac OS X."
    break
  end switch
end stsMakePDF

Other than that, can't you simply print it and in the print dialog 
choose "Save as PDF..." from the PDF dropdown menu in the Print dialog?

Ken Ray
Sons of Thunder Software, Inc.
Email: kray at sonsothunder.com
Web Site: http://www.sonsothunder.com/



More information about the use-livecode mailing list