Customizable Print Formats GSoC 2015

Gehad Elrobey gehadelrobey at gmail.com
Tue Mar 10 08:49:27 PDT 2015


On Sun, Mar 8, 2015 at 9:40 PM, Lubomir I. Ivanov <neolit123 at gmail.com> wrote:
> compared to what we do ATM - rendering the profile QWidget directly to
> QPrinter which produces vector (Win32 / OSX only), the introduction of
> SVG which is grabbed from a QWidget then displayed in QWebView which
> is then rendered to QPrinter surely will slow things down as it
> introduce an intermediate step (SVG).
>
> the alternative - somehow obtain the absolute position of the <div>
> (jQuery?) where the profile should be located and it's scaled
> dimensions on the page and then do QProfileWidget->render() at that
> exact location on top of the already rendered HTML template. this
> avoids SVG completely!
>

After I gave QWebView some tests I was able to render a QPicture on
the top of the QWebView in the area of the dive profile. Getting the
dive profile box location wasn't hard as I used
QWebFrame::findAllElements() so I even didn't use javascript or
JQuery.

Also by using our own rendering we will be able to provide printing
with different qualities (DPIs) as an option, but we will lose some
printing features that WebKit provides in its printing approach
QWebFrame::print() ex. "@media print"  "page-break-inside"  so we will
need to handle the pagination on our own.

I attached a pdf printout of the QWebview rendering the HTML template
and a QPicture rendered on top.

-- 
regards,
Gehad
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dive.pdf
Type: application/pdf
Size: 157670 bytes
Desc: not available
URL: <http://lists.subsurface-divelog.org/pipermail/subsurface/attachments/20150310/82cdcd24/attachment-0001.pdf>


More information about the subsurface mailing list