Re: Saving window to a PDF File
Re: Saving window to a PDF File
- Subject: Re: Saving window to a PDF File
- From: <email@hidden>
- Date: Sat, 01 Nov 2008 13:34:40 +0000
On Sat, 1 Nov 2008 11:45:43 +0000, dreamcat7 <email@hidden>
wrote:
>
> On 1 Nov 2008, at 10:20, <email@hidden>
> <email@hidden
> > wrote:
>
>> I'm not sure this is actually what I want to do. Basically at the
>> moment I
>> have a window with a tableview, and I want to save the contents of the
>> table with some other stuff to a PDF file.
> You can write a method in Cocoa that draws its objects onto an NSView.
>
> Because a tableview has scrollbars, then printing the tableview wont
> work. You will want to create an NSString which corresponds to each
> row of the table view and draw that to the NSView. You can draw
> anything you like into the NSView programmatically. NSString -
> drawInRect: withAttributes:
Thanks, a guide in the right direction,
>>
>>
>> Can anyone advise me on what type of view might be best?
>>
> Since you appear to be sourcing the data from a tableview in Cocoa,
> then it would probably make more sense to do it the Cocoa way as shown
> in the printing chapter of Arron Hillegass book.
...
> Try creating an NSView first and printing things out on in. Then
> theres the familiarity gained to be able to draw the items
> specifically wanted.
Thanks, so far I've created the view in IB, and laid out some of the data
on it. at least it gives me co-ordinates to work with if I have to create
it another way eventually.
>>
>>
>> I'm working on a cocoa application, not a document based one, so I
>> can't
>> really follow Ch 27 of the Cocoa Programming book as it deals with
>> documents?
> No, but its generally easier to follow if you do it on a .xcodeproj of
> the document - based raiseman application first. Otherwise you can
> have a go at 'translate' everything from the raiseman example into
> your application but may find highly confusing as to do it that way
> would be like learning two separate things at the same time and might
> find that just a bit too confusing. - but it shouldnt be!
In one of those funny coincidences, following your advice, I was looking to
see if it was possible to download the RaiseMan project in chapters or if I
would have to go through the whole book making it as I went, and found a
cocoacast screencast about ch 27 of the book. It was most helpful, I'm
still working through it but so far I do have a view that is printing, I
just need to convert my tableView contents (Array Controller) into a string
to output to the view and I'm nearly good to go on this.
Thank you so much for your guidance,
Amy
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden