question

27669006 avatar image
0 Votes"
27669006 asked LimitlessTechnology-2700 answered

V4 printer driver - Issue with setting XPS image quality to PNG Lossless

Hi,
Based on the Microsoft v4 printer driver architecture, I am developing a custom render filter which requires an input XPS that embeds images with PNG lossless quality.
An unexpected behaviour affects Microsoft Paint application when printing an image via a v4 printer driver because the image quality setting used for the XPS generation is completely ignored.

As an example, the issue is shown by printing a file with XPS Document Writer Printer because the underlying architecture of a v4 printer driver entirely depends on XPS generation.

1 - Open an image with paint

159339-immagine.png


2 - Open the advanced settings and set the image quality to PNG – Lossless compression

159328-immagine.png


3 - Print the image to an xps file

159363-immagine.png


4 - Unzip the xps file

159347-immagine.png


5 - Browse inside the folder <xps_file>\Documents\1\Resources\Images

159348-immagine.png

The unpacked XPS shows that internally the image has been stored with JPG format in place of the PNG format selected in the advanced setting of the printer.



The resulting XPS file (on the right) clearly shows lower quality and blurred artifacts

159285-immagine.png


This behaviour has been tested on Windows 10 Operating System for x64 architecture. Note that the input image has a 24bit RGB color format.
It seems that different image formats show different outcomes, even though the quality setting always seems to be ignored.

In addition, I have tried to set the directive PageOutputQuality.[option]=MxdcImageType.PNG in my custom v4 printer driver manifest file (for all draft, normal, high options) as described here:
v4-driver-manifest
Also with these directives, the PNG image quality settings is ignored

Is there any workaround to force PNG lossless image quality in the resulting XPS file? Is this a well-known behaviour?

Many thanks for any answer


windows-server-printwindows-hardware-wdk
immagine.png (27.0 KiB)
immagine.png (48.3 KiB)
immagine.png (54.5 KiB)
immagine.png (31.4 KiB)
immagine.png (25.9 KiB)
immagine.png (73.5 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

LimitlessTechnology-2700 avatar image
0 Votes"
LimitlessTechnology-2700 answered

Hello

I would recommend you to check this archived thread regarding the same issue, on how to define the quality of XPS printing:

https://social.msdn.microsoft.com/Forums/en-US/6783db57-6c3a-44f5-b93a-0ec570ed43b4/xps-print-quality-and-artifacts?forum=windowsxps

Hope this helps with your query,


--If the reply is helpful, please Upvote and Accept as answer--

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.