VB.NET Printing- how to use margins and scales

Posted on 2005-05-04
Last Modified: 2008-03-06
I have some easy question about printing.
I have a picture to print. I do not want to print it from the corner of the paper so I use
        PrintDocument1.OriginAtMargins = True
        PrintDocument1.DefaultPageSettings.Margins.Left = 200
        PrintDocument1.DefaultPageSettings.Margins.Top = 200

but it does not work ! I put the code in the printPage event and used a PrintPreviewDialog to see what will be printed. My picture appears at the very top left corner.

Another question: How can I convert Inches into pixels and the other way?
I thought 1inch= 79 pixels but it does not seem nearly right.
You can read some info about pixels at:
 This is very important in printing.
Maybe the default setting the paperSize.width is 8.5inches!!or is it?
Question by:Dan-Key
    1 Comment
    LVL 2

    Accepted Solution


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Find Ransomware Secrets With All-Source Analysis

    Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

    I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
    If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
    how to add IIS SMTP to handle application/Scanner relays into office 365.
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now