Printing PDF files from a faceless app

vm.mayer

Registered
Although I have been coding in various *NIX environments for over a decade, I am still trying to figure out this whole Darwin/Cocoa/Carbon "thing." Please excuse me if this is a stupid question...

I routinely download multiple PDF files from a remote site automatically using a Perl script invoked by a twice a day cron job. This means that twice a day, I need to manually check the download folder to see if I have any new files and, if so, print them by opening them with Reader 5.0. While this is not terribly difficult, it kinda undermines the idea of having a cron job automatically download them :rolleyes:.

So... What's my problem? My printer is a Lexmark Inkjet connected via USB.

If it were a postscript printer, I should be able to easily print the file by running it through pdf2ps and piping it to lpr.

But how on earth do I send it to a (PCL?) printer on a USB network? Reading through the documentation on printing in the OS X environment, it appears that print jobs are queued AS pdf files. Shouldn't it therefore be straightforward to simply add a pdf file to the queue???? :confused:

Thanks for any/all help
mike

------
C/C++
Java
Perl Perl/Tk
X11/Motif
MacOS / AIX / WinNT ( :( )

----
And while there might not be any stupid questions... There are plenty of ignorant people to ask them... I just pray I'm not one of them.
 
I've been doing some more digging through the online documentation and think I might be onto a somewhat convoluted solution...
  • Does anybody think this will (or won't) work ?
  • Can anybody see a way to shortcut this?
    [/list=a]
    Proposed Solution: :rolleyes:
    Build a faceless cocoa application which uses an NSPDFImageRep to load the pdf file. Use the PMxxx routines (with no user interaction) to print the pages of the NSPDFImageRep.

    Big Questions: :confused:
    • Is there a default printer if nobody is currently logged onto OSX? The machine would be on, but sitting at the login screen.
    • Will this be a lossless or a lossy translation of the original PDF?
      [/list=a]
      Thanks again for any/all help/suggestions :p
      mike
 
Back
Top