Formatting data for printing
Formatting data for printing
- Subject: Formatting data for printing
- From: Daniel DeCovnick <email@hidden>
- Date: Fri, 9 Feb 2007 13:41:52 -0800
Hi all,
I've got a Core Data-based app which is fairly simple; with a few
additions, it's just your basic database of records. What I'd like to
do is be able to print out individual records, but the UI which I use
to enter them is unsuitable for printing; there are a lot of
checkboxes, a few text fields, a calendar widget, and a table of sub-
entries. I need to get it all into a textual format, but I can't just
simply append each data point after the other, because then the
record would be pages and pages long. I've got a template I'm trying
to get it into; centered title, two or three columns across the page
most places, one page-wide column in two places not adjacent, etc.
I started by looking into the Cocoa text system, but I don't think
that alone can do what I want. The next thing I looked into was the
drawing system, and that seems a little more promising, but I'm not
sure if I'm on the right track, or, if I am, where to start. It seems
to me that my course of action should be to: subclass NSView and
implement the -drawRect: method, filling in NSTextViews with my data
(or textual representations of that data, which I do know how to get
at), and then set my app delegate(?) to print by calling the view's
print method, which I shouldn't have to override. To export to PDF, I
should only need to send the view a -pdfDataInRect: message.
Assuming any of that is right, that leaves a couple of questions
(aside from "am I on the right track"): how can I make sure that the
view will only be within the size of the printed page, what's the
best way to avoid overlapping sibling views, and where do I need to
keep the NSTextViews (as ivars? or can they be locals to -drawRect:)?
Thanks,
Dan
Daniel DeCovnick
danhd123 at mac dot com
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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