Skip to content
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

HTML doesn't handle oversize pages gracefully #33

Closed
tresf opened this issue Apr 13, 2016 · 3 comments
Closed

HTML doesn't handle oversize pages gracefully #33

tresf opened this issue Apr 13, 2016 · 3 comments
Assignees
Labels
Milestone

Comments

@tresf
Copy link
Contributor

tresf commented Apr 13, 2016

  • Create an html sample page
  • Accidentally set the options: { pageWidth: 400 } to 400 inches (e.g. incorrectly assuming it's pixels)
  • Software crashes with an UnsupportedOperationException

It appears since 9fc9277, the oversize page handling is a bit non-ideal. Perhaps this is intended, but after this occurs, Pixel printing (PDFs, HTML) fails to work properly.

@tresf tresf added the bug label Apr 13, 2016
@tresf tresf added this to the 2.0 milestone Apr 13, 2016
@akberenz
Copy link
Member

At that size it tries using a base width of 38400 pixels. Even at the default resolution of x1 that's going to be too large for JavaFX to handle. So you should see it fail to capture twice in the logs (once at zoom and again at default).

You mention that no other printing works after this. I'm not able to reproduce that. Are you getting any logs when attempting other prints after the failed html? Or did the system stop the program entirely?

@klabarge
Copy link
Member

So you should see it fail to capture twice in the logs (once at zoom and again at default).

Yes, I see two image capture failures.

Immediately after this crash I am able to do things like search for a printer, or list the network information. However, if I try to print the logs freeze at Found Resolution: 60000x60000 dphi

[DEBUG] 2016-04-13 18:25:41,605 @ qz.ws.PrintSocketClient:?
    Message: {"call":"print","promise":{},"params":{"printer":{"name":"Microsoft XPS Document Writer"},"options":{"colorType":"color","copies":"1","density":"","duplex":false,"interpolation":"","jobName":"","margins":"0","orientation":"","paperThickness":"","printerTray":"","rasterize":true,"rotation":"0","scaleContent":true,"size":null,"units":"in","altPrinting":false,"encoding":"","endOfDoc":"","perSpool":"1"},"data":[{"type":"pdf","data":"file:///C:/Program%20Files/QZ%20Tray/demo/assets/pdf_sample.pdf"}]},"timestamp":1460586341600,"uid":"kcudhm"}
[WARN] 2016-04-13 18:25:41,625 @ qz.ws.PrintSocketClient:?
    Bad signature on request
[INFO] 2016-04-13 18:25:43,341 @ qz.common.TrayManager:?
    Allowed localhost to print to Microsoft XPS Document Writer
[DEBUG] 2016-04-13 18:25:43,343 @ qz.printer.PrintServiceMatcher:?
    Searching for PrintService matching Microsoft XPS Document Writer
[DEBUG] 2016-04-13 18:25:43,346 @ qz.printer.PrintServiceMatcher:?
    Found 9 printers
[DEBUG] 2016-04-13 18:25:43,347 @ qz.printer.PrintServiceMatcher:?
    Found match: Microsoft XPS Document Writer
[WARN] 2016-04-13 18:25:43,349 @ qz.printer.PrintOptions:?
    Cannot read  as a double for density, using default
[WARN] 2016-04-13 18:25:43,352 @ qz.printer.PrintOptions:?
    Cannot read  as a valid value for interpolation, using default
[WARN] 2016-04-13 18:25:43,355 @ qz.printer.PrintOptions:?
    Cannot read  as a valid value for orientation, using default
[WARN] 2016-04-13 18:25:43,360 @ qz.printer.PrintOptions:?
    Cannot read  as a double for paperThickness, using default
[DEBUG] 2016-04-13 18:25:43,362 @ qz.utils.PrintingUtilities:?
    Found Resolution: 60000x60000 dphi

@akberenz
Copy link
Member

Turns out after a print fails from an exception, the processor was never returned to the pool.
Fixed via f19d54a

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants