[webkit-help] headless port
Derek B. Noonburg
derekn at glyphandcog.com
Fri Aug 30 15:18:42 PDT 2013
PhantomJS depends on Qt's rendering system to generate PDF. There are
some quality issues with the PDF output (with some specific sorts of
HTML content that a client is using). I believe I can do a better job
by directly targeting HTML-to-PDF conversion, rather than going through
Qt's QPainter API.
But that's certainly a fair question. I'll do some comparisons when my
code is working.
(I accidentally emailed this response directly to David instead of the
mailing list -- sorry.)
- Derek
On 2013 Aug 30, David Tucker wrote:
>
> Just out of curiosity, are you doing something that phantomjs doesn't?
>
> dave
>
>
> On Aug 30, 2013, at 11:35 AM, Derek B. Noonburg wrote:
>
>> I'm working on a custom WebKit port that converts HTML to a list of
>> drawing operations (essentially each GraphicsContext call generates an
>> entry on the list). The ultimate goal is an HTML-to-PDF converter. The
>> second part of the project will convert the list of drawing operations
>> to PDF.
>>
>> This is all being done "headless", without any sort of GUI.
>>
>> One problem I'm running into is the event loop. Right now, my code
>> loads a URL (FrameLoader::load()), and then goes into a loop to handle
>> timer callbacks (which are set with
>> WebCore::setSharedTimerFireInterval()). When loading is finished
>> (FrameLoaderClient::dispatchDidFinishLoad()), the event loop exits.
>>
>> That works fine for basic stuff, but doesn't handle asynchronous
>> JavaScript (e.g., if JavaScript code is waiting on a timer, or for
>> WebSocket data, etc.) at all.
>>
>> Is there a good way to handle this?
>>
>> I have the possibility of adding some JavaScript code to emit some sort
>> of "finished" signal (as long as the code can still run in a regular
>> browser). What would be the easiest way to pick up that signal from the
>> WebKit side? I haven't really looked into the JSC code very much yet.
>>
>> (If this post would be more appropriate on webkit-dev, please let me
>> know.)
>>
>> - Derek
>>
>> _______________________________________________
>> webkit-help mailing list
>> webkit-help at lists.webkit.org
>> https://lists.webkit.org/mailman/listinfo/webkit-help
>
More information about the webkit-help
mailing list