Printing resolution problems
Printing resolution problems
- Subject: Printing resolution problems
- From: "Joris Mans" <email@hidden>
- Date: Mon, 17 Apr 2006 01:35:13 +0200
- Importance: Normal
Hello
After breaking my head on this for about 12hours and browsing the net
for a solution I thought it was time to look for help here.
The problem is the following:
I want to print in my cocoa application. To do so I create an NSView
subclass which I put on an application-created window, So far so good,
the messages pass, I get custom page setup running and drawRect is
called with the correct rectangle sizes. Now I have created the view to
have a size of an A4 paper at 300 dpi. Now the weird thing is that no
matter what I try, the printing system seems to generate a 72dpi
"target" to print on, and that inside the drawRect function, when I look
for [[NSPrintOperation currentOperation] printInfo], its papersize is
always 72dpi, no matter what the output is (real printer, pdf file,
preview ).
Also, when printing the actual view, if I don't make my view to be
exactly the same size as the page size (so an A4 in 72dpi), it doesn't
scale my page to fit the output. Let me clarify: the size of my view is
exactly 1 page in A4 at 300 dpi, knowsPageRange returns YES and a range
of 1 page starting at page 1, rectForPage returns the full view size as
page rect, and drawRect receives that rect to draw its data into, yet
when looking at the result page what happened is that the app just took
a rectangular section the size of A4 in 72dpi out of my custom view to
put in the page, no resizing whatsoever.
Any idea how to control the dpi of the printed output, and/or how to get
scaling working?
Thanks
Joris
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden