Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Printing



On 2003-04-29 06:14:59 +0200 Carla Lewis <email@hidden> wrote:

My goal: print a custom report that I've dynamically built in memory from fields in a MySQL database.

I think you have two basic possibilities:
1. fill up and format a string with your logo and attributes, so the string will be an NSTextStorage object.
2. you can fill a standard NSView with fields, tables and images, which will not be visible to the user.

I just want to write dynamic rich text to the printer.

Any pointers?

The TextEdit source will be your tutorial

Fine tuning the print process can be watched in TextEdit's Document.m and MultiplePageView.m:
MultiplePageView is a NSView containing as much NSTextViews as necessary to show the complete text. It takes printInfos NSPaperSize for virtual pagination via resizing every page's own textView to fit into it's own page rect leaving enough space for margins.
This way you can easily include textFields, textViews or images as header and footer on every page.
Or draw what ever you like, e.g. page numbers, onto every page in it's drawRect method.

uko
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Printing (From: Carla Lewis <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.