Hi,
I need one information about print document. We are using following line of code in VB.NET WinForm application .
Dim print_document As New System.Drawing.Printing.PrintDocument
widthValue = print_document.PrinterSettings.DefaultPageSettings.Bounds.Width
In variable widthValue we are getting integer value.
Can anyone please tell what is the unit of this value? i.e. it's pixel, mm etc...
Thanks and Regards
Prasad
Loading

Sunny SharmaRank #223 · 11.1K reputationPosted May 23, 2013, 3:09 AM EDT
The unit is in Pixels for sure unless you don't change it explicitly.
"PrintDocument.PrinterSettings.DefaultPageSettings.Bounds" inherits a Rectangle (for reference please follow the link below) and a Rectangle has it's width defined in pixels by default. Refer to this and see the Remarks section: Rectangle.Width.
Please don't forget to accept this as answer if it helps!
Thanks.
VulpesRank #55 · 29.2K reputationPosted May 23, 2013, 2:07 AM EDT
http://msdn.microsoft.com/en-us/library/system.drawing.printing.pagesettings.bounds.aspx
Prasad Godbole153 reputationPosted May 23, 2013, 5:25 AM EDT
Thanks for giving information.
I am going through this.
Thanks and Regards
Prasad
Prasad Godbole153 reputationPosted May 23, 2013, 5:25 AM EDT
Thanks for giving information.
I am going through this.
Thanks and Regards
Prasad
Prasad Godbole153 reputationPosted May 28, 2013, 9:31 PM EDT
We are working on 1 WinForm application related to reports in which following code is there
_currentX = PrintDocument.PrinterSettings.DefaultPageSettings.Bounds.Width * (1440 / Dpix)
Here _currentX is X location to render text.
Can you please explain meaning of following code if you have any idea? i.e. what we are doing here and why
PrintDocument.PrinterSettings.DefaultPageSettings.Bounds.Width * (1440 / Dpix)
Here Dpix is the current system DPI setting value.
Thanks and Regards
Prasad
Sunny SharmaRank #223 · 11.1K reputationPosted May 28, 2013, 11:09 PM EDT
With this single line code snippet, I can only assume that it is used for scaling fonts dedicated to display on a particular output device. A value of 96 corresponds to 100% font scaling (smaller), 120 corresponds to 125% scaling (medium) and 144 corresponds to 150% scaling (larger). However, users are able to set values other than these standard ones.
Thanks.
Prasad Godbole153 reputationPosted May 28, 2013, 11:44 PM EDT
Thanks for giving information.
Thanks and Regards
Prasad