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 printing w/ margins #93

Closed
klabarge opened this issue Aug 8, 2016 · 3 comments
Closed

HTML printing w/ margins #93

klabarge opened this issue Aug 8, 2016 · 3 comments
Labels

Comments

@klabarge
Copy link
Member

klabarge commented Aug 8, 2016

When I try to print HTML with margins set to my PDF printer on Ubuntu 14.04, the result is a 0kb file.

I applied a 1" margin and this is the stacktrace:

    Allowed localhost to print to PDF
[DEBUG] 2016-08-08 18:44:51,128 @ qz.utils.PrintingUtilities:?
    Allowing 1 simultaneous processors based on memory available (921 MB)
[TRACE] 2016-08-08 18:44:51,131 @ qz.utils.PrintingUtilities:?
    Waiting for processor, 0/1 already in use
[DEBUG] 2016-08-08 18:44:51,210 @ qz.utils.PrintingUtilities:?
    Using qz.printer.action.PrintHTML to print
[DEBUG] 2016-08-08 18:44:51,213 @ qz.printer.PrintServiceMatcher:?
    Searching for PrintService matching PDF
[DEBUG] 2016-08-08 18:44:51,230 @ qz.printer.PrintServiceMatcher:?
    Found 3 printers
[DEBUG] 2016-08-08 18:44:51,236 @ qz.printer.PrintServiceMatcher:?
    Found match: PDF
[WARN] 2016-08-08 18:44:51,263 @ qz.printer.PrintOptions:?
    Cannot read  as a double for density, using default
[WARN] 2016-08-08 18:44:51,265 @ qz.printer.PrintOptions:?
    Cannot read  as a valid value for interpolation, using default
[WARN] 2016-08-08 18:44:51,271 @ qz.printer.PrintOptions:?
    Cannot read  as a valid value for orientation, using default
[WARN] 2016-08-08 18:44:51,273 @ qz.printer.PrintOptions:?
    Cannot read  as a double for paperThickness, using default
[DEBUG] 2016-08-08 18:44:51,368 @ qz.utils.ShellUtilities:?
    Executing: [lpstat, -a]
[DEBUG] 2016-08-08 18:44:51,494 @ qz.utils.ShellUtilities:?
    Executing: [lpoptions, -p, zebra, -l]
[DEBUG] 2016-08-08 18:44:51,628 @ qz.utils.ShellUtilities:?
    Executing: [lpoptions, -p, PDF, -l]
[DEBUG] 2016-08-08 18:44:51,773 @ qz.utils.ShellUtilities:?
    Parsed default density from CUPS PDF: 300dpi
[DEBUG] 2016-08-08 18:44:51,776 @ qz.utils.ShellUtilities:?
    Executing: [lpoptions, -p, Epson, -l]
[TRACE] 2016-08-08 18:44:52,142 @ qz.printer.action.WebApp:?
    Waiting for JavaFX..
libGL error: pci id for fd 69: 80ee:beef, driver (null)
OpenGL Warning: glFlushVertexArrayRangeNV not found in mesa table
OpenGL Warning: glVertexArrayRangeNV not found in mesa table
OpenGL Warning: glCombinerInputNV not found in mesa table
OpenGL Warning: glCombinerOutputNV not found in mesa table
OpenGL Warning: glCombinerParameterfNV not found in mesa table
OpenGL Warning: glCombinerParameterfvNV not found in mesa table
OpenGL Warning: glCombinerParameteriNV not found in mesa table
OpenGL Warning: glCombinerParameterivNV not found in mesa table
OpenGL Warning: glFinalCombinerInputNV not found in mesa table
OpenGL Warning: glGetCombinerInputParameterfvNV not found in mesa table
OpenGL Warning: glGetCombinerInputParameterivNV not found in mesa table
OpenGL Warning: glGetCombinerOutputParameterfvNV not found in mesa table
OpenGL Warning: glGetCombinerOutputParameterivNV not found in mesa table
OpenGL Warning: glGetFinalCombinerInputParameterfvNV not found in mesa table
OpenGL Warning: glGetFinalCombinerInputParameterivNV not found in mesa table
OpenGL Warning: glDeleteFencesNV not found in mesa table
OpenGL Warning: glFinishFenceNV not found in mesa table
OpenGL Warning: glGenFencesNV not found in mesa table
OpenGL Warning: glGetFenceivNV not found in mesa table
OpenGL Warning: glIsFenceNV not found in mesa table
OpenGL Warning: glSetFenceNV not found in mesa table
OpenGL Warning: glTestFenceNV not found in mesa table
libGL error: core dri or dri2 extension not found
libGL error: failed to load driver: vboxvideo
[TRACE] 2016-08-08 18:44:53,144 @ qz.printer.action.WebApp:?
    Waiting for JavaFX..
[DEBUG] 2016-08-08 18:44:53,605 @ qz.printer.action.WebApp:?
    Started JavaFX
[TRACE] 2016-08-08 18:44:54,146 @ qz.printer.action.WebApp:?
    Waiting for JavaFX..
[TRACE] 2016-08-08 18:44:55,153 @ qz.printer.action.WebApp:?
    Waiting for JavaFX..
[TRACE] 2016-08-08 18:44:56,164 @ qz.printer.action.WebApp:?
    Waiting for capture..
[TRACE] 2016-08-08 18:44:57,165 @ qz.printer.action.WebApp:?
    Waiting for capture..
[TRACE] 2016-08-08 18:44:57,818 @ qz.printer.action.WebApp:?
    Done: -1.0 > 0.0
[TRACE] 2016-08-08 18:44:57,820 @ qz.printer.action.WebApp:?
    New state: READY > SCHEDULED
[TRACE] 2016-08-08 18:44:57,822 @ qz.printer.action.WebApp:?
    New state: SCHEDULED > RUNNING
[TRACE] 2016-08-08 18:44:58,168 @ qz.printer.action.WebApp:?
    Waiting for capture..
[TRACE] 2016-08-08 18:44:59,061 @ qz.printer.action.WebApp:?
    Done: 0.0 > 35.24521681009274
[TRACE] 2016-08-08 18:44:59,169 @ qz.printer.action.WebApp:?
    Waiting for capture..
[TRACE] 2016-08-08 18:44:59,243 @ qz.printer.action.WebApp:?
    Done: 35.24521681009274 > 100.0
[TRACE] 2016-08-08 18:44:59,247 @ qz.printer.action.WebApp:?
    New state: RUNNING > SUCCEEDED
[TRACE] 2016-08-08 18:44:59,688 @ qz.printer.action.WebApp:?
    Zooming in by x4.166666666666667 for increased quality
[TRACE] 2016-08-08 18:44:59,688 @ qz.printer.action.WebApp:?
    Setting HTML page width to 2330.708694458008
[TRACE] 2016-08-08 18:44:59,837 @ qz.printer.action.WebApp:?
    Setting HTML page height to 1025.0
[DEBUG] 2016-08-08 18:44:59,946 @ qz.printer.action.WebApp:?
    Attempting image capture
[DEBUG] 2016-08-08 18:45:00,170 @ qz.printer.action.PrintHTML:?
    Parsed 1 html records
[TRACE] 2016-08-08 18:45:00,177 @ qz.printer.action.PrintPixel:?
    DPI: 300.0  CNV: 72.0
[TRACE] 2016-08-08 18:45:00,179 @ qz.printer.action.PrintPixel:?
    Drawable area: 1.0,1.0:3.8267717,6.2677164
[TRACE] 2016-08-08 18:45:00,181 @ qz.printer.action.PrintPixel:?
    [30000x30000 dphi, color, (25.4,25.4)->(97.2,159.2)mm]
[INFO] 2016-08-08 18:45:00,187 @ qz.printer.action.PrintPixel:?
    Starting printing (1 copies)
[WARN] 2016-08-08 18:45:00,188 @ qz.printer.action.PrintPixel:?
    Supported printer densities not found
[TRACE] 2016-08-08 18:45:00,275 @ qz.printer.action.PrintImage:?
    Requested page 0 for printing
[DEBUG] 2016-08-08 18:45:00,276 @ qz.printer.action.PrintImage:?
    Scaling image up by x1.0
[DEBUG] 2016-08-08 18:45:00,313 @ qz.printer.action.PrintImage:?
    Paper area: 72,72:275,451
[TRACE] 2016-08-08 18:45:00,314 @ qz.printer.action.PrintImage:?
    Image size: 275.5275573730469,121.15647632233936
[TRACE] 2016-08-08 18:45:00,318 @ qz.printer.action.PrintImage:?
    {Text-specific antialiasing enable key=Default antialiasing text mode, Image interpolation method key=Bicubic image interpolation mode, Color rendering quality key=Highest quality color rendering mode, Global antialiasing enable key=Antialiased rendering mode, Fractional metrics enable key=Integer text metrics mode, Stroke normalization control key=Pure stroke conversion for accurate paths, Text-specific LCD contrast key=140, Alpha blending interpolation method key=Highest quality alpha blending methods, Global rendering quality key=Highest quality rendering methods}
[TRACE] 2016-08-08 18:45:00,339 @ qz.printer.action.PrintImage:?
    Requested page 0 for printing
[DEBUG] 2016-08-08 18:45:00,341 @ qz.printer.action.PrintImage:?
    Scaling image up by x1.0
[DEBUG] 2016-08-08 18:45:00,395 @ qz.printer.action.PrintImage:?
    Paper area: 72,72:275,451
[TRACE] 2016-08-08 18:45:00,401 @ qz.printer.action.PrintImage:?
    Image size: 275.5275573730469,121.15647632233936
[TRACE] 2016-08-08 18:45:00,404 @ qz.printer.action.PrintImage:?
    {Text-specific antialiasing enable key=Default antialiasing text mode, Image interpolation method key=Bicubic image interpolation mode, Color rendering quality key=Highest quality color rendering mode, Global antialiasing enable key=Antialiased rendering mode, Fractional metrics enable key=Integer text metrics mode, Stroke normalization control key=Pure stroke conversion for accurate paths, Text-specific LCD contrast key=140, Alpha blending interpolation method key=Highest quality alpha blending methods, Global rendering quality key=Highest quality rendering methods}
[INFO] 2016-08-08 18:45:02,244 @ qz.utils.PrintingUtilities:?
    Printing complete
[TRACE] 2016-08-08 18:45:02,247 @ qz.utils.PrintingUtilities:?
    Returning processor back to pool
@klabarge
Copy link
Member Author

klabarge commented Aug 8, 2016

Apparently there's a Virtualbox + 64-bit Linux guest + 3d graphics bug with OpenGL. Here is a stacktrace on Ubuntu running on hardware. Still results in a 0kb file.

[INFO] 2016-08-08 18:58:27,180 @ qz.common.TrayManager:?
    Allowed localhost to print to PDF
[DEBUG] 2016-08-08 18:58:27,326 @ qz.utils.PrintingUtilities:?
    Allowing 1 simultaneous processors based on memory available (908 MB)
[TRACE] 2016-08-08 18:58:27,327 @ qz.utils.PrintingUtilities:?
    Waiting for processor, 0/1 already in use
[DEBUG] 2016-08-08 18:58:27,340 @ qz.utils.PrintingUtilities:?
    Using qz.printer.action.PrintHTML to print
[DEBUG] 2016-08-08 18:58:27,341 @ qz.printer.PrintServiceMatcher:?
    Searching for PrintService matching PDF
[DEBUG] 2016-08-08 18:58:27,341 @ qz.printer.PrintServiceMatcher:?
    Found 1 printers
[DEBUG] 2016-08-08 18:58:27,341 @ qz.printer.PrintServiceMatcher:?
    Found match: PDF
[WARN] 2016-08-08 18:58:27,346 @ qz.printer.PrintOptions:?
    Cannot read  as a double for density, using default
[WARN] 2016-08-08 18:58:27,346 @ qz.printer.PrintOptions:?
    Cannot read  as a valid value for interpolation, using default
[WARN] 2016-08-08 18:58:27,347 @ qz.printer.PrintOptions:?
    Cannot read  as a valid value for orientation, using default
[WARN] 2016-08-08 18:58:27,347 @ qz.printer.PrintOptions:?
    Cannot read  as a double for paperThickness, using default
[DEBUG] 2016-08-08 18:58:27,362 @ qz.utils.ShellUtilities:?
    Executing: [lpstat, -a]
[DEBUG] 2016-08-08 18:58:27,371 @ qz.utils.ShellUtilities:?
    Executing: [lpoptions, -p, PDF, -l]
[DEBUG] 2016-08-08 18:58:27,381 @ qz.utils.ShellUtilities:?
    Parsed default density from CUPS PDF: 600dpi
[TRACE] 2016-08-08 18:58:27,412 @ qz.printer.action.WebApp:?
    Waiting for JavaFX..
[DEBUG] 2016-08-08 18:58:27,671 @ qz.printer.action.WebApp:?
    Started JavaFX
[TRACE] 2016-08-08 18:58:28,414 @ qz.printer.action.WebApp:?
    Waiting for capture..
[TRACE] 2016-08-08 18:58:28,557 @ qz.printer.action.WebApp:?
    Done: -1.0 > 0.0
[TRACE] 2016-08-08 18:58:28,558 @ qz.printer.action.WebApp:?
    New state: READY > SCHEDULED
[TRACE] 2016-08-08 18:58:28,559 @ qz.printer.action.WebApp:?
    New state: SCHEDULED > RUNNING
[TRACE] 2016-08-08 18:58:28,763 @ qz.printer.action.WebApp:?
    Done: 0.0 > 35.24521681009274
[TRACE] 2016-08-08 18:58:28,803 @ qz.printer.action.WebApp:?
    Done: 35.24521681009274 > 100.0
[TRACE] 2016-08-08 18:58:28,803 @ qz.printer.action.WebApp:?
    New state: RUNNING > SUCCEEDED
[TRACE] 2016-08-08 18:58:28,848 @ qz.printer.action.WebApp:?
    Zooming in by x8.333333333333334 for increased quality
[TRACE] 2016-08-08 18:58:28,848 @ qz.printer.action.WebApp:?
    Setting HTML page width to 6800.000000000001
[TRACE] 2016-08-08 18:58:28,955 @ qz.printer.action.WebApp:?
    Setting HTML page height to 2050.0
[DEBUG] 2016-08-08 18:58:29,060 @ qz.printer.action.WebApp:?
    Attempting image capture
[DEBUG] 2016-08-08 18:58:29,414 @ qz.printer.action.PrintHTML:?
    Parsed 1 html records
[TRACE] 2016-08-08 18:58:29,416 @ qz.printer.action.PrintPixel:?
    DPI: 600.0  CNV: 72.0
[TRACE] 2016-08-08 18:58:29,416 @ qz.printer.action.PrintPixel:?
    Drawable area: 1.0,1.0:6.5,9.0
[TRACE] 2016-08-08 18:58:29,416 @ qz.printer.action.PrintPixel:?
    [(25.4,25.4)->(165.1,228.6)mm, color, 60000x60000 dphi]
[INFO] 2016-08-08 18:58:29,417 @ qz.printer.action.PrintPixel:?
    Starting printing (1 copies)
[WARN] 2016-08-08 18:58:29,417 @ qz.printer.action.PrintPixel:?
    Supported printer densities not found
[TRACE] 2016-08-08 18:58:29,428 @ qz.printer.action.PrintImage:?
    Requested page 0 for printing
[DEBUG] 2016-08-08 18:58:29,428 @ qz.printer.action.PrintImage:?
    Scaling image up by x1.0
[DEBUG] 2016-08-08 18:58:29,497 @ qz.printer.action.PrintImage:?
    Paper area: 72,72:468,648
[TRACE] 2016-08-08 18:58:29,498 @ qz.printer.action.PrintImage:?
    Image size: 468.0,141.08823529411765
[TRACE] 2016-08-08 18:58:29,498 @ qz.printer.action.PrintImage:?
    {Stroke normalization control key=Pure stroke conversion for accurate paths, Color rendering quality key=Highest quality color rendering mode, Global antialiasing enable key=Antialiased rendering mode, Alpha blending interpolation method key=Highest quality alpha blending methods, Text-specific antialiasing enable key=Default antialiasing text mode, Fractional metrics enable key=Integer text metrics mode, Text-specific LCD contrast key=140, Image interpolation method key=Bicubic image interpolation mode, Global rendering quality key=Highest quality rendering methods}
[TRACE] 2016-08-08 18:58:29,502 @ qz.printer.action.PrintImage:?
    Requested page 0 for printing
[DEBUG] 2016-08-08 18:58:29,502 @ qz.printer.action.PrintImage:?
    Scaling image up by x1.0
[DEBUG] 2016-08-08 18:58:29,572 @ qz.printer.action.PrintImage:?
    Paper area: 72,72:468,648
[TRACE] 2016-08-08 18:58:29,572 @ qz.printer.action.PrintImage:?
    Image size: 468.0,141.08823529411765
[TRACE] 2016-08-08 18:58:29,573 @ qz.printer.action.PrintImage:?
    {Stroke normalization control key=Pure stroke conversion for accurate paths, Color rendering quality key=Highest quality color rendering mode, Global antialiasing enable key=Antialiased rendering mode, Alpha blending interpolation method key=Highest quality alpha blending methods, Text-specific antialiasing enable key=Default antialiasing text mode, Fractional metrics enable key=Integer text metrics mode, Text-specific LCD contrast key=140, Image interpolation method key=Bicubic image interpolation mode, Global rendering quality key=Highest quality rendering methods}
[INFO] 2016-08-08 18:58:33,328 @ qz.utils.PrintingUtilities:?
    Printing complete
[TRACE] 2016-08-08 18:58:33,329 @ qz.utils.PrintingUtilities:?
    Returning processor back to pool

@tresf
Copy link
Contributor

tresf commented Aug 11, 2016

Not able to reproduce (Java 8u77), although still suffering from #32.

image

I tried with the Epson, and it printed exactly as expected (scaling, natural size and margins).

Closing as invalid, since this does not appear to have changed behavior since 2.0.0.

@tresf tresf closed this as completed Aug 11, 2016
@tresf tresf added the invalid label Aug 11, 2016
@klabarge
Copy link
Member Author

Upgrading GhostScript to version 9.15 resolved this for me.

Steps from bug report #92:

sudo apt-add-repository ppa:anton+/photo-video-apps
sudo apt-get update
sudo apt-get install --reinstall ghostscript

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

2 participants