New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows rasterize: false results in nearest-neighbor #257

Closed
klabarge opened this Issue Nov 20, 2017 · 3 comments

Comments

Projects
None yet
3 participants
@klabarge
Contributor

klabarge commented Nov 20, 2017

  • When using rasterize: false for HTML and image printing, outcome appears to be nearest-neighbor

OS: Windows 10 (not reproducible in macOS)
QZ Tray: Tested using 2.0.5 RC1 and 2.0.4
Code: sample.html printImage() and printHTML() functions

image

@klabarge

This comment has been minimized.

Contributor

klabarge commented Nov 29, 2017

More information on this bug:

  • Printing using rasterize: false makes images look as if nearest-neighbor is applied. This is also reproducible using HTML printing, which is unexpected.

  • This pixelation does not happen in macOS

  • A further look at the logs indicate that a DPI of 0 is being set when prints aren't rasterized. This also happens in macOS, so I assume this is expected?

  • It looks like this issue dates back to 2.0.2. I can't reproduce this in 2.0.1, however the file sizes are identical between rasterize: true and rasterize: false so I'm not sure this feature was working.

Image printing, rasterize: false

image

[DEBUG] 2017-11-28 19:07:15,852 @ qz.ws.PrintSocketClient:?
	Message: {"call":"print","promise":{},"params":{"printer":{"name":"PDFCreator"},"options":{"colorType":"color","copies":"1","density":"0","duplex":false,"fallbackDensity":null,"interpolation":"","jobName":"Image rasterize: false","margins":"0","orientation":"","paperThickness":"","printerTray":"","rasterize":false,"rotation":"0","scaleContent":true,"size":null,"units":"in","altPrinting":false,"encoding":"","endOfDoc":"","perSpool":"1"},"data":[{"type":"image","data":"file:///C:/Program%20Files/QZ%20Tray/demo/assets/img/image_sample.png"}]},"timestamp":1511914035851,"uid":"gsfx29"}
[WARN] 2017-11-28 19:07:15,854 @ qz.ws.PrintSocketClient:?
	Bad signature on request
[INFO] 2017-11-28 19:07:16,684 @ qz.common.TrayManager:?
	Allowed localhost to print to PDFCreator
[TRACE] 2017-11-28 19:07:16,685 @ qz.utils.PrintingUtilities:?
	Waiting for processor, 0/7 already in use
[DEBUG] 2017-11-28 19:07:16,685 @ qz.utils.PrintingUtilities:?
	Using qz.printer.action.PrintImage to print
[DEBUG] 2017-11-28 19:07:16,685 @ qz.printer.PrintServiceMatcher:?
	Searching for PrintService matching PDFCreator
[DEBUG] 2017-11-28 19:07:16,686 @ qz.printer.PrintServiceMatcher:?
	Found 12 printers
[DEBUG] 2017-11-28 19:07:16,686 @ qz.printer.PrintServiceMatcher:?
	Found match: PDFCreator
[WARN] 2017-11-28 19:07:16,686 @ qz.printer.PrintOptions:?
	Cannot read  as a valid value for interpolation, using default
[WARN] 2017-11-28 19:07:16,687 @ qz.printer.PrintOptions:?
	Cannot read  as a valid value for orientation, using default
[WARN] 2017-11-28 19:07:16,687 @ qz.printer.PrintOptions:?
	Cannot read  as a double for paperThickness, using default
[DEBUG] 2017-11-28 19:07:16,688 @ qz.utils.PrintingUtilities:?
	Found Resolution: 60000x60000 dphi
[DEBUG] 2017-11-28 19:07:16,696 @ qz.printer.action.PrintImage:?
	Parsed 1 images for printing
[TRACE] 2017-11-28 19:07:16,703 @ qz.printer.action.PrintPixel:?
	DPI: 0.0	CNV: 72.0
[TRACE] 2017-11-28 19:07:16,703 @ qz.printer.action.PrintPixel:?
	Drawable area: 0.0,0.0:8.5,11.0
[TRACE] 2017-11-28 19:07:16,703 @ qz.printer.action.PrintPixel:?
	[(0.0,0.0)->(215.9,279.4)mm, color]
[INFO] 2017-11-28 19:07:16,707 @ qz.printer.action.PrintPixel:?
	Starting printing (1 copies)
[TRACE] 2017-11-28 19:07:16,727 @ qz.printer.action.PrintImage:?
	Requested page 0 for printing
[TRACE] 2017-11-28 19:07:16,731 @ qz.printer.action.PrintImage:?
	Requested page 0 for printing
[DEBUG] 2017-11-28 19:07:16,733 @ qz.printer.action.PrintImage:?
	Scaling image up by x1.0
[DEBUG] 2017-11-28 19:07:16,733 @ qz.printer.action.PrintImage:?
	Paper area: 0,0:612,792
[TRACE] 2017-11-28 19:07:16,734 @ qz.printer.action.PrintImage:?
	Image size: 612.0,244.79999999999998
[TRACE] 2017-11-28 19:07:16,734 @ qz.printer.action.PrintImage:?
	{Global rendering quality key=Highest quality rendering methods, Alpha blending interpolation method key=Highest quality alpha blending methods, Text-specific antialiasing enable key=Default antialiasing text mode, Text-specific LCD contrast key=140, Color rendering quality key=Highest quality color rendering mode, Global antialiasing enable key=Antialiased rendering mode, Fractional metrics enable key=Integer text metrics mode, Image interpolation method key=Bicubic image interpolation mode, Stroke normalization control key=Pure stroke conversion for accurate paths}
[DEBUG] 2017-11-28 19:07:16,735 @ qz.printer.action.PrintImage:?
	Memory: 548m/3623m
[INFO] 2017-11-28 19:07:16,742 @ qz.utils.PrintingUtilities:?
	Printing complete
[TRACE] 2017-11-28 19:07:16,742 @ qz.utils.PrintingUtilities:?
	Returning processor back to pool

Image printing, rasterize: true

image

[DEBUG] 2017-11-28 19:06:24,021 @ qz.ws.PrintSocketClient:?
	Message: {"call":"print","promise":{},"params":{"printer":{"name":"PDFCreator"},"options":{"colorType":"color","copies":"1","density":"0","duplex":false,"fallbackDensity":null,"interpolation":"","jobName":"htmlfalse","margins":"0","orientation":"","paperThickness":"","printerTray":"","rasterize":true,"rotation":"0","scaleContent":true,"size":null,"units":"in","altPrinting":false,"encoding":"","endOfDoc":"","perSpool":"1"},"data":[{"type":"image","data":"file:///C:/Program%20Files/QZ%20Tray/demo/assets/img/image_sample.png"}]},"timestamp":1511913984020,"uid":"7e8ay5"}
[WARN] 2017-11-28 19:06:24,023 @ qz.ws.PrintSocketClient:?
	Bad signature on request
[INFO] 2017-11-28 19:06:25,078 @ qz.common.TrayManager:?
	Allowed localhost to print to PDFCreator
[TRACE] 2017-11-28 19:06:25,079 @ qz.utils.PrintingUtilities:?
	Waiting for processor, 0/7 already in use
[DEBUG] 2017-11-28 19:06:25,079 @ qz.utils.PrintingUtilities:?
	Using qz.printer.action.PrintImage to print
[DEBUG] 2017-11-28 19:06:25,079 @ qz.printer.PrintServiceMatcher:?
	Searching for PrintService matching PDFCreator
[DEBUG] 2017-11-28 19:06:25,080 @ qz.printer.PrintServiceMatcher:?
	Found 12 printers
[DEBUG] 2017-11-28 19:06:25,080 @ qz.printer.PrintServiceMatcher:?
	Found match: PDFCreator
[WARN] 2017-11-28 19:06:25,080 @ qz.printer.PrintOptions:?
	Cannot read  as a valid value for interpolation, using default
[WARN] 2017-11-28 19:06:25,081 @ qz.printer.PrintOptions:?
	Cannot read  as a valid value for orientation, using default
[WARN] 2017-11-28 19:06:25,081 @ qz.printer.PrintOptions:?
	Cannot read  as a double for paperThickness, using default
[DEBUG] 2017-11-28 19:06:25,082 @ qz.utils.PrintingUtilities:?
	Found Resolution: 60000x60000 dphi
[DEBUG] 2017-11-28 19:06:25,090 @ qz.printer.action.PrintImage:?
	Parsed 1 images for printing
[TRACE] 2017-11-28 19:06:25,098 @ qz.printer.action.PrintPixel:?
	DPI: 600.0	CNV: 72.0
[TRACE] 2017-11-28 19:06:25,098 @ qz.printer.action.PrintPixel:?
	Drawable area: 0.0,0.0:8.5,11.0
[TRACE] 2017-11-28 19:06:25,098 @ qz.printer.action.PrintPixel:?
	[(0.0,0.0)->(215.9,279.4)mm, 60000x60000 dphi, color]
[INFO] 2017-11-28 19:06:25,103 @ qz.printer.action.PrintPixel:?
	Starting printing (1 copies)
[TRACE] 2017-11-28 19:06:25,127 @ qz.printer.action.PrintImage:?
	Requested page 0 for printing
[TRACE] 2017-11-28 19:06:25,131 @ qz.printer.action.PrintImage:?
	Requested page 0 for printing
[DEBUG] 2017-11-28 19:06:25,132 @ qz.printer.action.PrintImage:?
	Scaling image up by x8.333333333333334
[DEBUG] 2017-11-28 19:06:25,202 @ qz.printer.action.PrintImage:?
	Paper area: 0,0:612,792
[TRACE] 2017-11-28 19:06:25,202 @ qz.printer.action.PrintImage:?
	Image size: 612.0,244.6530612244898
[TRACE] 2017-11-28 19:06:25,203 @ qz.printer.action.PrintImage:?
	{Global rendering quality key=Highest quality rendering methods, Alpha blending interpolation method key=Highest quality alpha blending methods, Text-specific antialiasing enable key=Default antialiasing text mode, Text-specific LCD contrast key=140, Color rendering quality key=Highest quality color rendering mode, Global antialiasing enable key=Antialiased rendering mode, Fractional metrics enable key=Integer text metrics mode, Image interpolation method key=Bicubic image interpolation mode, Stroke normalization control key=Pure stroke conversion for accurate paths}
[DEBUG] 2017-11-28 19:06:25,205 @ qz.printer.action.PrintImage:?
	Memory: 436m/3623m
[INFO] 2017-11-28 19:06:25,328 @ qz.utils.PrintingUtilities:?
	Printing complete
[TRACE] 2017-11-28 19:06:25,329 @ qz.utils.PrintingUtilities:?
	Returning processor back to pool
[DEBUG] 2017-11-28 19:07:06,194 @ qz.ws.PrintSocketClient:?
	Message: {"call":"print","promise":{},"params":{"printer":{"name":"PDFCreator"},"options":{"colorType":"color","copies":"1","density":"0","duplex":false,"fallbackDensity":null,"interpolation":"","jobName":"Image Rasterize: true","margins":"0","orientation":"","paperThickness":"","printerTray":"","rasterize":true,"rotation":"0","scaleContent":true,"size":null,"units":"in","altPrinting":false,"encoding":"","endOfDoc":"","perSpool":"1"},"data":[{"type":"image","data":"file:///C:/Program%20Files/QZ%20Tray/demo/assets/img/image_sample.png"}]},"timestamp":1511914026190,"uid":"j17sxb"}
[WARN] 2017-11-28 19:07:06,197 @ qz.ws.PrintSocketClient:?
	Bad signature on request
[INFO] 2017-11-28 19:07:07,189 @ qz.common.TrayManager:?
	Allowed localhost to print to PDFCreator
[TRACE] 2017-11-28 19:07:07,190 @ qz.utils.PrintingUtilities:?
	Waiting for processor, 0/7 already in use
[DEBUG] 2017-11-28 19:07:07,191 @ qz.utils.PrintingUtilities:?
	Using qz.printer.action.PrintImage to print
[DEBUG] 2017-11-28 19:07:07,191 @ qz.printer.PrintServiceMatcher:?
	Searching for PrintService matching PDFCreator
[DEBUG] 2017-11-28 19:07:07,192 @ qz.printer.PrintServiceMatcher:?
	Found 12 printers
[DEBUG] 2017-11-28 19:07:07,192 @ qz.printer.PrintServiceMatcher:?
	Found match: PDFCreator
[WARN] 2017-11-28 19:07:07,193 @ qz.printer.PrintOptions:?
	Cannot read  as a valid value for interpolation, using default
[WARN] 2017-11-28 19:07:07,193 @ qz.printer.PrintOptions:?
	Cannot read  as a valid value for orientation, using default
[WARN] 2017-11-28 19:07:07,194 @ qz.printer.PrintOptions:?
	Cannot read  as a double for paperThickness, using default
[DEBUG] 2017-11-28 19:07:07,194 @ qz.utils.PrintingUtilities:?
	Found Resolution: 60000x60000 dphi
[DEBUG] 2017-11-28 19:07:07,214 @ qz.printer.action.PrintImage:?
	Parsed 1 images for printing
[TRACE] 2017-11-28 19:07:07,220 @ qz.printer.action.PrintPixel:?
	DPI: 600.0	CNV: 72.0
[TRACE] 2017-11-28 19:07:07,220 @ qz.printer.action.PrintPixel:?
	Drawable area: 0.0,0.0:8.5,11.0
[TRACE] 2017-11-28 19:07:07,221 @ qz.printer.action.PrintPixel:?
	[(0.0,0.0)->(215.9,279.4)mm, 60000x60000 dphi, color]
[INFO] 2017-11-28 19:07:07,227 @ qz.printer.action.PrintPixel:?
	Starting printing (1 copies)
[TRACE] 2017-11-28 19:07:07,247 @ qz.printer.action.PrintImage:?
	Requested page 0 for printing
[TRACE] 2017-11-28 19:07:07,250 @ qz.printer.action.PrintImage:?
	Requested page 0 for printing
[DEBUG] 2017-11-28 19:07:07,251 @ qz.printer.action.PrintImage:?
	Scaling image up by x8.333333333333334
[DEBUG] 2017-11-28 19:07:07,319 @ qz.printer.action.PrintImage:?
	Paper area: 0,0:612,792
[TRACE] 2017-11-28 19:07:07,319 @ qz.printer.action.PrintImage:?
	Image size: 612.0,244.6530612244898
[TRACE] 2017-11-28 19:07:07,320 @ qz.printer.action.PrintImage:?
	{Global rendering quality key=Highest quality rendering methods, Alpha blending interpolation method key=Highest quality alpha blending methods, Text-specific antialiasing enable key=Default antialiasing text mode, Text-specific LCD contrast key=140, Color rendering quality key=Highest quality color rendering mode, Global antialiasing enable key=Antialiased rendering mode, Fractional metrics enable key=Integer text metrics mode, Image interpolation method key=Bicubic image interpolation mode, Stroke normalization control key=Pure stroke conversion for accurate paths}
[DEBUG] 2017-11-28 19:07:07,321 @ qz.printer.action.PrintImage:?
	Memory: 502m/3623m
[INFO] 2017-11-28 19:07:07,450 @ qz.utils.PrintingUtilities:?
	Printing complete

@tresf tresf added this to the 2.0.8 milestone Sep 27, 2018

@bberenz

This comment has been minimized.

Member

bberenz commented Oct 9, 2018

Can you retest this after 3b87899?

@tresf

This comment has been minimized.

Contributor

tresf commented Oct 10, 2018

Fixed, thanks!

@tresf tresf closed this Oct 10, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment