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 382449
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T15:11:01+00:00 2026-05-12T15:11:01+00:00

I use the WPF Printing Path to handle big large diagrams created in our

  • 0

I use the WPF Printing Path to handle big large diagrams created in our application. The whole diagram consists of visuals.

A so called “DesignerPaginator” paginates the diagram (it is quite simple).
From this point, I do the following three thing:
– I print the Document with PrintDialog.PrintDocument(Paginator, Title)
– I also create a XPS Document with XpsDocumentWriter.Write(Paginator, PrintTicket); which I save on the HDD
– From the XPSDocument I assign XpsDocumentWriter.GetFixedDocumentSequence() to a DocumentViewer

In a nutshell, following code is important:

PrintDialog _pdialog = new PrintDialog();
System.Printing.ValidationResult result = this.PrintQueue.MergeAndValidatePrintTicket(this.PrintQueue.UserPrintTicket, this.PrintTicket);

_pdialog.PrintTicket = result.ValidatedPrintTicket;
XpsDocument _xpsDocument = new XpsDocument("C:\\test.xps",FileAccess.ReadWrite);
XpsDocumentWriter xpsdw = XpsDocument.CreateXpsDocumentWriter(_xpsDocument);
xpsdw.Write(this.Paginator, result.ValidatedPrintTicket);
documentviewer.Document = _xpsDocument.GetFixedDocumentSequence();
_xpsDocument.Close();

_pdialog.PrintQueue = this.PrintQueue;
_pdialog.PrintDocument(this.Paginator, "Model Test");

The output is the following:

XPS on HDD -> absolutely blurry. You can’t recognize anything. It’s like a GIF File with a 100x Zoom.
FixedDocumentSequence from the XPSDocument in the DocumentViewer -> Perfect. This should be what the XPS File is meant to be
Print output -> Horrible, blurry, but at least much better than the xps file

And now the mysterious part: If I print directly from the DocumentViewer (in which the FixedDocumentSequence seems perfect), I get the same blurry output from the first print.

My thought about this case is that the WPF’s XPS System rasterize the content and place the stuff as low quality Bitmap within the xps Document. It’s all vectors, and despite this fact the output always seems familiar to a low resolution bitmap.

I would appreciate any help. I’m out of ideas. I tried a lot to debug this problem, but it somehow seems to be something simple and delicate at the same time.

  • 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-12T15:11:02+00:00Added an answer on May 12, 2026 at 3:11 pm

    I found out how to avoid my problem, but I can’t guarantee the solution also applies to yours.
    In fact, it seems that using two nested VisualBrushes projected on your Visual you are using results in the blurry output.

    One VisualBrush we use in wpf printing cannot be avoided: it is the one that is applied through our Paginator to cut the Visual and distribute it onto multiple pages.
    I also had one UserControl that served as “Template”. I draw a Rectangle with the VisualBrush of our diagram into the UserControl, and after this operation the UserControl itself is draw itself as Rectangle with a VisualBrush onto the pages by the paginator.
    Since WPF’s printing path uses XPS for printing, you can also create an XPSDocument, change the file type to zip, extract it and analyse one page of your document with any text editor.
    This will greatly help you understand your problem.

    I also suspect that the document is “rasterized” when the content of the VisualBrush isn’t applied with the original 1:1 height/width ratio the Visual has.
    Errors within a resizing calculation led to a 1:0.9948 Height/Width Ratio for the applied VisualBrush, and this led to a blurry output (excluding the “nested VisualBrush” problem).

    This is still just a suspicion. My problem has been solved by excluding the “extra” VisualBrush and respecting the original aspect ratio. It is also possible to assume that one /or both problems only appear in combination with a certain Visual/Effect/Transformation or even LinearBrushes.

    At least, I learned one thing about the WPF Printing Path when it comes to such issues: Think of the fact that your stuff always gets converted to xps behind the scene, and xps is similar to wpf, but doesn’t support anything wpf does. In fact, If I didn’t missunderstood it, XPS was the inspiration for XAML in WPF.

    I would also greatly welcome any real answer to this problem. My problem is solved, but I want to know why it did happen.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I use WPF diagram component from MindFusion (MindFusion.Diagramming.Wpf.Diagram). XAML: ... <Grid> <diag:Diagram x:Name=diagram/> </Grid>
I want to use WPF windows in a legacy win32 application. I'd like to
I have wpf application and it needs report printing. for example daily, monthly sales.
I have a WPF application and I use external library for generating documents. This
I am trying to use WPF printing from PowerShell. I have found a simple
I'm currently using PrintVisual() in a wpf application to do printing. This is working
I have a reasonably large application in C#/WPF made with MVVM (sort of). In
I have a WPF application where I use a document viewer. I also start
I am trying to use WPF to create a dock application in the style
I want use WPF on Windows version of my java application. I found it

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.