# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1318919323 0 # Node ID f8673299ec378e0a29d4bc3252107a0fb46b1474 # Parent 46de4dbe710d638fdd4a92d893319d9122e4122e Ok if we setup the print information on Mac we get a better size... and we don't need to do adjustments down the line. diff -r 46de4dbe710d -r f8673299ec37 mac/dw.m --- a/mac/dw.m Tue Oct 18 00:37:07 2011 +0000 +++ b/mac/dw.m Tue Oct 18 06:28:43 2011 +0000 @@ -9623,6 +9623,16 @@ /* Get the page range */ pi = [NSPrintInfo sharedPrintInfo]; + [pi setHorizontalPagination:NSFitPagination]; + [pi setHorizontallyCentered:YES]; + [pi setVerticalPagination:NSFitPagination]; + [pi setVerticallyCentered:YES]; + [pi setOrientation:NSLandscapeOrientation]; + [pi setLeftMargin:0.0]; + [pi setRightMargin:0.0]; + [pi setTopMargin:0.0]; + [pi setBottomMargin:0.0]; + settings = [pi PMPrintSettings]; PMSetPageRange(settings, 1, pages); PMSetFirstPage(settings, 1, true); @@ -9672,13 +9682,6 @@ pi = p->pi; size = [pi paperSize]; - /* Okay the size reported is really small... and everything - * in Cocoa is scaled so ... multiply by 2 to get a better - * resolution but maintain the right aspect ratio. - */ - size.width *= 2; - size.height *= 2; - /* Get the page range */ settings = [pi PMPrintSettings]; PMGetFirstPage(settings, &start); @@ -9690,12 +9693,6 @@ PMSetLastPage(settings, 1, true); [pi updateFromPMPrintSettings]; - /* Adjust the image size according to - * the number of pages to be printed. - */ - if((end - start) > 1) - size.height /= (end - start); - /* Create an image view to print and a pixmap to draw into */ iv = [[NSImageView alloc] init]; pixmap = dw_pixmap_new(iv, (int)size.width, (int)size.height, 8);