Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Interesting (and annoying) issue - you may want to check out the lengthy answer from <em>Jo0815</em> to <a href="http://social.msdn.microsoft.com/Forums/en-US/windowsxps/thread/be7ecc30-d304-486f-a0bf-5dfcb5a795db" rel="nofollow noreferrer">Printing XpsDocument causes resampled images (96dpi?) - FixedDocument prints sharp</a>, quoting a Microsoft support response - a couple of excerpts:</p> <blockquote> <p>Some vector features from WPF cannot be emulated in our GDI code and we resort to converting subsets of the scene to GDI bitmaps. These bitmaps are the cause of the blurred zooming.</p> <p>[...]</p> <p>These bitmaps are the cause of the blurred zooming. The problem is that the WPF is being rasterised to a bitmap at the -wrong resolution. The print path is designed to rasterise unsupported features into a bitmap, but it is supposed to do it at device resolution. Instead <strong>the rasterisation is always being done at 96dpi. That's fine for a screen but produces blurred output for a 600dpi printer</strong>. <em>[emphasis mine]</em></p> </blockquote> <p>Please note that the latter will apply for nowadays higher DPI screens as well of course, I've encountered blurring like this various times already - do you by chance use a high DPI monitor?</p> <p>Now, apparently Microsoft is not entirely in control of the apparatus regarding this:</p> <blockquote> <p>Additionally the problem only occurs when printing XPS and isn't a problem when printing XAML directly. I'm pretty sure there is documentation somewhere that says XPS will print at device resolution. [...] <strong>It is something we plan to improve in the next version of the product but not for Win 7.</strong> The problem is that when printing XAML it will correctly render the image at 600dpi, but when printing XPS it will still render the image at 96dpi. <strong>Since XAML is converted to XPS before printing it seems highly odd that one method of printing XPS produces different results to another method of printing XPS.</strong> <em>[emphasis mine]</em></p> <p>[...] </p> <p>There is no UI to configure the XPS Document Writer DPI. If you later print a generated XPS document at a different DPI from the writers internal default you may get poor results for bitmap content. With GDI printers you can control the final DPI and your final desitination is usally paper - no chance to reprint the document.</p> </blockquote> <h3>Conclusion</h3> <p>In conclusion, I'd still try to adjust <a href="http://msdn.microsoft.com/en-us/library/system.printing.printticket.pageresolution.aspx" rel="nofollow noreferrer">PrintTicket.PageResolution Property</a> within <a href="https://stackoverflow.com/a/9005509/45773">Néstor Sánchez' approach</a> (+1), if your use case does allow this (though I remotely recall reading somewhere, that this doesn't have any effect as well); section <em>Bitmap Resolution and Pixel Format</em> in <a href="http://msdn.microsoft.com/en-us/library/windows/hardware/ff563662%28v=vs.85%29.aspx" rel="nofollow noreferrer">Using the XPS Rasterization Service</a> confirms the issue he encountered with <em>FixedDocument</em>:</p> <blockquote> <p>XPS rasterizer object for a fixed page must know the resolution at which the page will be rendered. The XPSDrv filter specifies this resolution, in dots per inch (DPI), as an input parameter [...] For example, if a display device has a resolution of 600 DPI, and a fixed page describes a standard letter-size page, a bitmap image of the entire page has the following dimensions [...]</p> </blockquote> <h2>Workaround</h2> <p>As a potential workaround you might want to explore alexandrud's solution for the related question <a href="https://stackoverflow.com/a/9033124/45773">How to convert a XPS file to an image in high quality (rather than blurry low resolution)?</a>, which recommends using <a href="http://sourceforge.net/projects/xps2img/" rel="nofollow noreferrer">xps2img</a>, a <em>XPS (XML Paper Specification) document to set of images conversion utility.</em> In particular it <em>Allows to specify images size or DPI</em>, which might help depending on the print path solution applied in turn.</p> <p>Good luck! </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload