[Okular-devel] Bug 321956 - Make paragraphs look nicer (indentation, alignment)

Afief Halumi afief.h at gmail.com
Sat Oct 17 20:25:24 UTC 2015


> Okular basically just needs you to render into an image, if you can do
that
> with Qt WebEngine, you can do it, also you need to support text extraction
> with positions so that search works.

Well I know that Caligra uses QWebPage to render its epub documents, so it
is definitely possible. Unfortunately it extracts the epub to /tmp and then
loads the files from there. As far as I can tell there is no way to alter
the way QWebPage loads its resources the way that QTextDocument can.

How do you feel about extracting the contents to a temporary folder before
reading it? I know libepub provides a nice API that doesn't require
extracting anything for rendering, but it doesn't look like it'll be simple
to use with QWebPage.

> Basically you need to replace the use of qtextdocument with something else
> while still implementing the generator plugin api.

Is there some documentation on the generator plugin api?

Thanks

On Sat, Oct 17, 2015 at 5:06 PM Albert Astals Cid <aacid at kde.org> wrote:

> El Saturday 17 October 2015, a les 12:26:27, Afief Halumi va escriure:
> > Hello,
>
> Hi
>
> > I've been reading a lot of epub files using Okular lately and this
> specific
> > bug has been extremely annoying. I tried to look at what is causing it in
> > the codebase and it seems that QTextDocument doesn't support the CSS
> > properties used by many documents.
> >
> > I would like to work on fixing this issue if that's OK with you guys, but
> > I'm at a bit of a loss as to where to start... Is the correct approach
> here
> > to add the missing properties in the Qt side of things? But then again,
> > books will start using more and more CSS and we will continue playing
> catch
> > up. Is the correct approach to use Qt's WebEngine facilities to render
> the
> > document? That should support most (all?) of the relevant CSS properties,
> > but I'm not sure if the Okular architecture supports such a change or
> even
> > if Qt WebEngine can be used in such a way.
>
> Okular basically just needs you to render into an image, if you can do that
> with Qt WebEngine, you can do it, also you need to support text extraction
> with positions so that search works.
>
> > Would be great if someone could give me a couple of pointers on how to
> > approach this issue. I have some basic experience with Qt, but I only
> used
> > it to create basic management GUIs and never for something as complex as
> > document rendering.
>
> Basically you need to replace the use of qtextdocument with something else
> while still implementing the generator plugin api.
>
> Good luck :)
>
> Cheers,
>   Albert
>
> >
> > Thanks,
> > Afief Halumi
>
> _______________________________________________
> Okular-devel mailing list
> Okular-devel at kde.org
> https://mail.kde.org/mailman/listinfo/okular-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/okular-devel/attachments/20151017/7e430aa6/attachment.html>


More information about the Okular-devel mailing list