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 SharmaPosted May 23, 2013, 7:09 AM
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.
Prasad GodbolePosted May 29, 2013, 3:44 AM
Thanks for giving information.
Thanks and Regards
Prasad
Sunny SharmaPosted May 29, 2013, 3:09 AM
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 GodbolePosted May 29, 2013, 1:31 AM
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
Prasad GodbolePosted May 23, 2013, 9:25 AM
Thanks for giving information.
I am going through this.
Thanks and Regards
Prasad
Prasad GodbolePosted May 23, 2013, 9:25 AM
Thanks for giving information.
I am going through this.
Thanks and Regards
Prasad
VulpesPosted May 23, 2013, 6:07 AM
http://msdn.microsoft.com/en-us/library/system.drawing.printing.pagesettings.bounds.aspx