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

Albert Astals Cid aacid at kde.org
Sat Oct 17 20:43:27 UTC 2015


El Saturday 17 October 2015, a les 20:25:24, Afief Halumi va escriure:
> > 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.

I'd prefer not to extract stuff, it's always harder to make sure you cleanup 
properly.

> 
> > 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?

generator.h and Mainpage.dox

> 
> 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



More information about the Okular-devel mailing list