[futurebasic] Re: [FB] Saving File as PDF

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : July 2004 : Group Archive : Group : All Groups

From: Robert Covington <artlythere@...>
Date: Mon, 19 Jul 2004 13:16:31 -0400
On Monday, July 19, 2004, at 02:55  AM, Robert Purves wrote:

> Robert Covington wrote:
>>>>>>  I need a way to save
>>>>>> the report as a PDF file without any user intervention.
>>>>> In OS X, you just call PMSessionSetDestination at the appropriate 
>>>>> stage in the print setup
>>>> What's the non-mangling way to set a corresponding printRect so 
>>>> that the whole image shows up if it is larger than a default page?
>>> toolbox fn PMSetScale( PMPageFormat pageFormat, double scalePercent 
>>> ) = OSStatus
>> Thanks RP...but...I meant whole image as in full size, not scaling.
>> I do not want to scale the image, that's only helpful if wanting to 
>> print it, and I already have autosizing/auto-cropping code in place, 
>> per user choice.
> Well, I don't think scaling actually loses anything.  You can Zoom In, 
> in Preview, and all the pixels are there, not squished or blurred. But 
> I see that the image is embedded in a printer-page-sized area.

Mine were squished.

>> I need whatever Apple is doing when it saves a screenshot at full 
>> size, to PDF
> Ah, now I understand.  This seems to do what you want (it gives a pdf 
> with properties identical to what you get from capture-screen-to-file 
> Cmd-Shift-3).
> toolbox fn PMSetUnadjustedPaperRect( ¬
>    PMPageFormat  pageFormat, ¬
>    const PMRect *paperRect ) = OSStatus

That's the ticket , works as expected now. Cool, thanks.

I downloaded the spec from Adobe yesterday...if I can figure out the 
exact obj's needed for a sampled Image XObject, then I'll just write 
these direct and go about my bidness. It's really not too involved for 
a basic level of spec.

Question..can one use OS X's gnuZIP'er to compress a bytestream and 
return it back out so that I can send that to the PDF, and then have 
the PDF spec the usual (as Apple uses) FlateDecode (ZIP) filter?

If not, I'll just PDF uncompressed (disk waste, but no worse than a 
non-compresed TIFF or PICT)

I have better things to do than that right now though,  and your Print 
To PDF hack lets me save PDF's now, which is nice... I won't have to 
divert them to a Save As other format dialog anymore.