PDF

PDF

Post by Payma » Mon, 13 Sep 2004 01:58:58


Hi all,

Is it possible to generate a PDF File without using PrintDialog (Libs, or
Printing special APIs) ?
I have a LBevelButton in a window "Save to PDF" and i must generate a PDF
file from myLView!

I am in Powerplant CW9.3 and Panther .


thanks

Payman
 
 
 

PDF

Post by David Phil » Mon, 13 Sep 2004 03:33:05

In article <41432ed1$0$317$ XXXX@XXXXX.COM >,



(1)
The PDF file format is documented in "Portable Document Format Reference
Manual", published by Addison-Wesley, ISBN 0-201-62628-4, $24.95

and that document refers to the "Postcript Language Reference Manual",
published by Addison-Wesley, ISBN 0-201-18127-4, $31.95

It is just a file, you can write it with ordinary file output
primitives, such as putc() or FSWrite().

A PDF file is basicly a wrapper for a subset of Postscript.

To translate Quickdraw drawing to appropriate Postscript commands, you
install Quickdraw bottleneck callbacks, then draw your LView.

I did something similar 10 years ago: when porting a Mac program to Sun
Unix, I used an abstract class tp define an interface, with three
implementations: one called Quickdraw, (only compiled in the Macintosh
version), one called X11 drawing calls (only compiled on Sun), and the
third generated a postscript command text string equivalent.

(2)
If you draw your LView into an LGWorld, then you can create a
QuicktimeGraphicExporter using that GWorld and export using the
kQTFileTypePDF component. This will give you a pixmap in a PDF.

(Although, in one program I wrote, that gets the canonical list of
Graphic Exporters from Quicktime, PDF is not listed.)

(3)
In Core Graphics, you can create an output file using
CGPDFContextCreateWithURL(), then anything you draw into the returned
CGContextRef will be written as PDF to the output. (Naturally, this is
OS X only.) The Core Graphics framework is in the Application Services
framework.

 
 
 

PDF

Post by Payma » Mon, 13 Sep 2004 19:36:14

Hi David

Thanks

Solution (1) is too long for me (Project timing and planning)
Solution (3) only OS X and our application is OS9/X for this release (snif)
Solution (2) is better for this moment (our next release is only OS X and
CGPDFContextCreateWithURL)

Thanks
Payman

"David Phillip Oster" < XXXX@XXXXX.COM > a rit dans le message de


or
PDF
 
 
 

PDF

Post by Payma » Tue, 14 Sep 2004 08:15:57

Hello,



What is a QuicktimeGraphicExporter ?
I try this :

OSErr err;
GraphicsExportComponent ge=nil;

err=OpenADefaultComponent(GraphicsExporterComponentType,kOTFileTypePDF,&ge);

I have a -2003 (cant find handler) Error! and i dont found anything about
PDF export components
(Work with PNG file type ...)

Any idea ?

thanks
 
 
 

PDF

Post by doug » Sat, 18 Sep 2004 23:57:15

Way easier than all this is to print the document but use
PMSessionSetDestination to write it out to a PDF file.

This only works in X.

-doug