Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8118415

WebView cannot be printed

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 8
    • Fix Version/s: 8
    • Component/s: javafx
    • Labels:
    • Subcomponent:
      web

      Description

      WebView is not printed when submitted to PrinterJob.printPage().

      There is a number of problems related to printing a WebView:
      1) WebPage should not try to print contents of the backbuffer as that would result in upscaling. Instead it should request a complete repaint and flush the resulting rendering queue onto the printer.
      2) PrinterGraphics is a J2DGraphics, while PrismImages typically hold D3D/GL textures. Those cannot be rendered onto a PrinterGraphics directly, so we should convert them temporarily to J2D textures.
      3) WCGraphicsPrismContext.init() has the following code:
          baseGraphics = g != null ? g.getRenderTarget().createGraphics() : null;
          createGraphics() causes an exception with the implementation of PrinterGraphics we get when printing.
      4) PrismInvoker.runOnRenderThread() assumes it can be called from either FX thread or Render thread. As printing may occur on any thread, this assumption is no longer correct.

      This bug applies to printing WebView as a Node. A separate issue, RT-17666, discusses printing WebView _contents_ as a document.

        Attachments

          Activity

            People

            Assignee:
            peterz Peter Zhelezniakov
            Reporter:
            peterz Peter Zhelezniakov
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported: