[Okular-devel] I: Re: R: Re: suggestion to improve ePub generator

E L nakeee at gmail.com
Sat Dec 1 20:01:56 UTC 2012


Hi,
May I suggest opening a bug report?
With a proper patch and maybe a before and after screen shots?

Ely
On Fri, Nov 30, 2012 at 8:03 PM, insight.am at libero.it
<insight.am at libero.it>wrote:

> The right code should be
> mTextDocument->setDefaultStyleSheet("div { max-width:600px;}  img {
> max-width:
> 600px;max-height:
> 800px;}");
> because divs can be layed down over pages.
> However, I tried it and unfortunately it seems not to work.
> Neither works putting the css code into the css file of the ePub itself and
> then recompressing it.
> Probably the QTextDocument QT class itself has to be inspected. I do not
> know
> if it is possible.
> Regards
>
> >----Messaggio originale----
> >Da: insight.am at libero.it
> >Data: 30-nov-2012 17.31
> >A: <aacid at kde.org>, <okular-devel at kde.org>
> >Cc: <nakeee at gmail.com>
> >Ogg: R: Re: [Okular-devel] R: Re:  suggestion to improve ePub generator
> >
> >Hi,
> >at present time I am not able to check it out because of some trouble with
> my
> >development environment but I think that a good start could be adding the
> >following code to okular/generators/epub/converter.cpp file:
> >mTextDocument->setDefaultStyleSheet("div, img {
> max-width:600px;max-height:
> >800px;}");
> >after the line
> >mTextDocument->setPageSize(QSizeF(600, 800));
> >in class member
> >QTextDocument* Converter::convert( const QString &fileName )
> >If you have an ePub eBook with overflowing images (I tried a book from
> >O'Reilly) you can easily check it out. I included div tags because often
> images
> >are enclosed in one of them, sometimes with margins.
> >Best regards
> >Angelo (unplugged)
> >
> >>----Messaggio originale----
> >>Da: aacid at kde.org
> >>Data: 30-nov-2012 0.34
> >>A: <okular-devel at kde.org>, "insight.am at libero.it"<insight.am at libero.it>
> >>Cc: <nakeee at gmail.com>
> >>Ogg: Re: [Okular-devel] R: Re:  suggestion to improve ePub generator
> >>
> >>El Dimecres, 28 de novembre de 2012, a les 18:25:50,
> insight.am at libero.it
> va
> >>escriure:
> >>> Hi Ely,Css is part of the ePub standard, right, but there are no exact
> >rules
> >>> for images, that is, they are not necessarily forced into a certain
> layout.
> >>> So in ePub readers they are usually shrinked and become so little. The
> >>> Okular rendering is good and similar to a "real book" layout (like pdf)
> but
> >>> the images are overflowed, but it can be fixed according to me, as I
> >>> proposed. I think it's not bad to add some css rule, because the
> >>> QTextDocument will process them too. I know you are in charge of the
> ePub
> >>> generator so you can perform some experiments. I studied the ePub
> format
> so
> >>> what I know is at your disposal. Regards
> >>
> >>Well, if you know how to code you can send your patch and then we'll
> have a
> >>look at it and see if it makes sense (i.e. it's a big hack) or not (i.e.
> >looks
> >>nice code :-)).
> >>
> >>Cheers,
> >>  Albert
> >>
> >>>
> >>>
> >>>
> >>> ----Messaggio originale----
> >>>
> >>> Da: nakeee at gmail.com
> >>>
> >>> Data: 28-nov-2012 18.08
> >>>
> >>> A: "insight.am at libero.it"<insight.am at libero.it>, "Okular
> >>> development"<okular-devel at kde.org>
> >>>
> >>> Ogg: Re: [Okular-devel] suggestion to improve ePub generator
> >>>
> >>>
> >>>
> >>> Hi
> >>> The css is part of the ePub standard. The way I see it there are two
> >>> options:
> >>>
> >>> - There is a bug in QTextDocument and then it should be fixed
> >>> - There is a bug in the css of the ePub and then it should be handled
> in
> >the
> >>> book.
> >>>
> >>>
> >>> Either way I don't think we should mess with the CSS.
> >>> But this is just my humble opinion...
> >>>
> >>> Ely
> >>>
> >>> On Wed, Nov 28, 2012 at 6:53 PM, insight.am at libero.it<insight.am at libero.
> >it>
> >>> wrote:
> >>>
> >>>
> >>> Hello,
> >>>
> >>> I would like to suggest a possible improvement of ePub generator.
> Whether
> >>> this idea is right or wrong I await your response, so please do not
> ignore
> >>> it. I see that when an ePub file is opened in Okular the images are
> >>> horizontally overflowed and sometimes vertically overflowed. If the
> HTML
> >>> text of the ePub is passed to QTextDocument then some css rules can be
> >>> easily added for images so they are not cropped when displayed on
> page. It
> >>> could be fulfilled by adding some strings in the right place. What do
> you
> >>> think about it?
> >>> Thank you for any response.
> >>>
> >>>
> >>>
> >>> _______________________________________________
> >>>
> >>> Okular-devel mailing list
> >>>
> >>> Okular-devel at kde.org
> >>>
> >>> https://mail.kde.org/mailman/listinfo/okular-devel
> >>
> >
> >
>
>
> _______________________________________________
> 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/20121201/98106f9a/attachment.html>


More information about the Okular-devel mailing list