Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Printing NSView Questions

Printing NSView Questions
Thread Tools
Senior User
Join Date: Feb 2003
Location: USA
Status: Offline
Reply With Quote
Feb 14, 2007, 09:21 AM
 
I'm relatively new to printing, so if this is a stuoid question, or if I'm going about this the
wrong way, please forgive me.

I've got a document based Cocoa app that uses a table view in the document window. For printing I'm
using a second offscreen window and table view to control formatting. The offscreen window contains
an NSView. Within that view are some text fields, then the table view. The table is getting the
data from the same source as the visible table view.

The problem is when the table view scrolls. If the document contains a lot of rows, the view truncates
the prinout.

I'm thinking I need to somehow dynamically change the size of the view to accomodate the entire
contents of the table, but am not sure how to go about it.

Any thoughts would be appreciated!
MacBook 2.0 160/2GB/SuperDrive
Lots of older Macs
     
Professional Poster
Join Date: Nov 2000
Location: Tasmania, Australia
Status: Offline
Reply With Quote
Feb 14, 2007, 10:25 PM
 
Just thinking out loud, without trying this, but I think it ought to work...

You could try to get the table view's frame (ie NOT the enclosing scroll view's frame), and then resize the enclosing scroll view's frame to fit that vertical size, and then resize the scroll view's enclosing superview's frame by the same amount.

Of course, if it ends up being taller than a single page, you've then got to think about forcing the location of page breaks to be between table rows, not in the middle of a table row, but there are NSView methods for this.
     
Senior User
Join Date: Feb 2003
Location: USA
Status: Offline
Reply With Quote
Feb 16, 2007, 06:05 PM
 
Further research has revealed that I really shouldn't be printing table views, even though it suits my needs just fine. I found numerous threads pointing to the use of a WebView and formatted HTML/CSS strings...

Brass, that's what I was initially thinking I had to do, but it does seem kludgy, so I'm rethinking this whole printing dilemma.

Thanks for the input.
MacBook 2.0 160/2GB/SuperDrive
Lots of older Macs
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 02:46 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2