Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > .NET 2.0 and Visual Studio. 2005 > .NET Framework 2.0
.NET Framework 2.0 For discussion of the Microsoft .NET Framework 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the .NET Framework 2.0 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old December 6th, 2008, 06:23 AM
Registered User
Join Date: Dec 2008
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default how to retrive paper sizes of default printer

See the following :

Dim pp As New PrinterSettings
Dim p1 As PaperSize = Nothing

For Each ps As PaperSize In pp.PaperSizes
            If ps.PaperName.Contains("A4") Then
                p1 = ps
                Exit For
            End If
        TextBox1.Text = p1.Width
        TextBox2.Text = p1.Height
        TextBox3.Text = p1.Kind 'paper size
        TextBox4.Text = p1.RawKind

when i set HP Laser Jet 1022 printer as default printer then
i am not getting proper value as paper size
e.g. for A4, paper size is 9 but i am getting some other value.

so is there any other code to get proper paper size to all printer.

Similar Threads
Thread Thread Starter Forum Replies Last Post
Set Paper Size (custom also) to default Printer gaurikhot .NET Framework 2.0 2 December 6th, 2008 01:50 AM
Default printer anukagni Access 3 March 21st, 2006 08:10 AM
Printer.Paper size problem in VB. :) venkatesh_anmca Access VBA 1 March 21st, 2005 04:09 AM
Reverse feed paper in dot matrix printer yeetesh VB How-To 0 February 15th, 2005 02:46 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.