Printing content of any iframe window and not just main frame window

Issue #3303 invalid
Ronen Mizrahi created an issue

The current printing functions, Print() and PrintToPDF() are provided at the browser host level and are always applied to the main frame. In Javascript however one can invoke window.print() and also iframe.contentWindow.print() (requires focus() first but generally works). Unless I am missing something the current CEF implementation assumes printing is always on the main frame and currently there is no way to:

  • Distinguish between the two cases when receiving print related notifications .e.g in OSR when using a print handler
  • Invoke printing on a frame other than the main frame

Is this correct or am I missing something?

Comments (4)

  1. Marshall Greenblatt

    Distinguish between the two cases when receiving print related notifications .e.g in OSR when using a print handler

    What is the use case for this?

    Invoke printing on a frame other than the main frame

    You can use ExecuteJavaScript to call window.print() on the desired frame.

  2. Ronen Mizrahi reporter

    I indeed do window.print() on the desired frame but CEF in OSR still prints the main frame when implementing the print handler.

  3. Ronen Mizrahi reporter

    Sorry, looks like it is my mistake, the OnPrintJob() handler receives a PDF with the correct content.

  4. Log in to comment