Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Qt and Flash in a headless environment
QtWS25 Last Chance

Qt and Flash in a headless environment

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 2.2k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    Ebennett
    wrote on last edited by
    #1

    I am using phantomjs (http://www.phantomjs.org/) to try to generate a PDF from a web page. If you are not familiar with it, phantomjs is a headless browser driven by Javascript, capable of rendering HTML pages in several formats. Unfortunately, the flash content is not rendering.

    Some preliminaries:
    phantomjs version: 1.1.0
    Qt version: 4.7.4
    System: Windows XP SP3

    I've been struggling with this for some time, so I downloaded the Qt source and built it for Windows. After a couple of days, I finally got an environment where I can debug phantomjs and QT.

    Looking at the Gecko NPAPI documentation, I found the following tidbit (https://developer.mozilla.org/en/Gecko_Plugin_API_Reference/Drawing_and_Event_Handling)

    "Before it can repaint or refresh part of its drawing area, a windowless plug-in must first invalidate the area with either of these browser methods: NPN_InvalidateRect or NPN_InvalidateRegion. Both methods perform the same operations:

    •They invalidate the specified drawing area prior to repainting or refreshing.
    •They pass an update event or a paint message to the plug-in.

    The browser redraws invalid areas of the document and windowless plug-ins at regularly timed intervals. To force a paint message, the plug-in can call NPN_ForceRedraw after calling one of the invalidate methods. If a plug-in calls one of these methods, it receives a paint message asynchronously. "

    I was able to set a breakpoint in the NPN_InvalidateRect method, and follow it through to the end of its processing. I see the invalidation occur, but I don't see a paint message being sent back to the plugin, or a call to NPN_ForceRedraw. In a headless environment, I don't believe a WM_PAINT will be sent "at regularly timed intervals", so the NPN_InvalidateRect should be calling NPN_ForceRedraw, should it not?

    Anyways, I think this is the root of the problem, but I'm just not sure. Can anyone verify or dispute my conclusion? Is anyone able to render Flash content in a headless browser on Windows? Perhaps phantomjs, as a headless browser, should be doing something that it isn't?

    Any help would be very much appreciated.

    Earl

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved