Mercurial > dwindows
changeset 1237:f8673299ec37
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.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Tue, 18 Oct 2011 06:28:43 +0000 |
parents | 46de4dbe710d |
children | 700ce342aab8 |
files | mac/dw.m |
diffstat | 1 files changed, 10 insertions(+), 13 deletions(-) [+] |
line wrap: on
line diff
--- 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);