Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7624479
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T04:58:34+00:00 2026-05-31T04:58:34+00:00

I am attempting to print a WPF control 4 tall by 3 wide. I

  • 0

I am attempting to print a WPF control 4″ tall by 3″ wide.

I have used a ScaleTransform on the control (a Canvas) to scale it accordingly; however, when I print to a printer part of the image is cut off (the top and left edges).

According to this thread:

The reason of this problem is that the printer provides an unprinted margin around the edge of the paper, but the PrintDialog.PrintVisual method intends to print to the edge of the paper. So the area that lies in the unprinted margin around the edge of the paper is clipped.

The thread fails to mention how to retrieve the margins or how to force the printer to ignore these margins. How do I obtain these values so that I can print using WPF without clipping?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T04:58:35+00:00Added an answer on May 31, 2026 at 4:58 am

    You’ll need to combine information from the PrintDocumentImageableArea with the Measure and Arrange members on your UIElement:

    // I could not find another way to change the margins other than the dialog
    var result = printDialog.ShowDialog();
    if (result.HasValue && result.Value)
    {
        var queue = printDialog.PrintQueue;
    
        // Contains extents and offsets
        var area = queue.GetPrintCapabilities(printDialog.PrintTicket)
                        .PageImageableArea;
    
        // scale = area.ExtentWidth and area.ExtentHeight and your UIElement's bounds
        // margin = area.OriginWidth and area.OriginHeight
        // 1. Use the scale in your ScaleTransform
        // 2. Use the margin and extent information to Measure and Arrange
        // 3. Print the visual
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm attempting to print a bitmap from an Espon receipt printer. The full error
Attempting to get Spring internationalization working. I have used classpath:messages basename, created .properties files
I have a project written in C# in VS2010. I am attempting to print
I'm attempting to perform some simple panning on a WPF Canvas object with its
I have an array that I am attempting to print. I would like to
I'm currently attempting to print a document from WPF. I'm using the web browser
So I'm attempting to print a multiplication table in C# however I can't quite
I have the below code and I'm attempting to print out only the first
I'm attempting to print a number of WPF controls (datagrid, charts etc) that are
I am attempting to print a JPEG file that I reference using a Uri

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.