Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Monaj

macrumors regular
Original poster
May 24, 2009
193
0
Hi all,

I am facing some problem in print layout, below is the description of steps I followed and problem which I am facing:

1. I have taken a custom view over which there are NSTextViews, NSTableViews arranged one below other.

2. I am trying to calculate exact height of NSTextViews and NSTableViews depending upon content in them.

3. Depending upon calculated height I am arranging them in super-custom view.

4. Then I am printing the view, using this code :

Code:
  [self arrangeBriefLayoutDynamically]; // step 2nd and 3rd
	
        // setting fixed parameters for printing
	NSPrintInfo * printInfo = [NSPrintInfo sharedPrintInfo];
	[printInfo setVerticallyCentered:NO];
	[printInfo setRightMargin:12.0]; 
	[printInfo setTopMargin:37.0];
	[printInfo setLeftMargin:12.0];
	[printInfo setHorizontallyCentered:YES];
	
	[printInfo setHorizontalPagination:NSFitPagination];
	[printInfo setVerticalPagination:NSAutoPagination];  // so that print can be obtained on multiple pages
	[printInfo setPaperName:@"na-letter"];
	[printInfo setOrientation:NSPortraitOrientation];
	PMSetScale([printInfo PMPageFormat], 100.0);
	
	[NSPrintInfo setSharedPrintInfo:printInfo];
	
	[briefCompleteView print:nil];

Problem is : when size of a table view or text view exceeds, such that it crosses the page boundary then SOMETIMES text near boundary appears improper i.e.. part of its height lies on first page and rest of it lies on second page , ( you can see it here )

Can anyone suggest me some way to resolve it :confused:

Thanks,

Monaj
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.