<div dir="ltr">Hi,<br>May I suggest opening a bug report?<br>With a proper patch and maybe a before and after screen shots?<br><br>Ely<br><div class="gmail_quote">On Fri, Nov 30, 2012 at 8:03 PM, <a href="mailto:insight.am@libero.it">insight.am@libero.it</a> <span dir="ltr"><<a href="mailto:insight.am@libero.it" target="_blank">insight.am@libero.it</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">The right code should be<br>
mTextDocument->setDefaultStyleSheet("div { max-width:600px;}  img { max-width:<br>
600px;max-height:<br>
800px;}");<br>
because divs can be layed down over pages.<br>
However, I tried it and unfortunately it seems not to work.<br>
Neither works putting the css code into the css file of the ePub itself and<br>
then recompressing it.<br>
Probably the QTextDocument QT class itself has to be inspected. I do not know<br>
if it is possible.<br>
Regards<br>
<br>
>----Messaggio originale----<br>
>Da: <a href="mailto:insight.am@libero.it">insight.am@libero.it</a><br>
>Data: 30-nov-<a href="tel:2012" value="+9722012">2012</a> 17.31<br>
>A: <<a href="mailto:aacid@kde.org">aacid@kde.org</a>>, <<a href="mailto:okular-devel@kde.org">okular-devel@kde.org</a>><br>
>Cc: <<a href="mailto:nakeee@gmail.com">nakeee@gmail.com</a>><br>
>Ogg: R: Re: [Okular-devel] R: Re:  suggestion to improve ePub generator<br>
><br>
>Hi,<br>
>at present time I am not able to check it out because of some trouble with<br>
my<br>
>development environment but I think that a good start could be adding the<br>
>following code to okular/generators/epub/converter.cpp file:<br>
>mTextDocument->setDefaultStyleSheet("div, img { max-width:600px;max-height:<br>
>800px;}");<br>
>after the line<br>
>mTextDocument->setPageSize(QSizeF(600, 800));<br>
>in class member<br>
>QTextDocument* Converter::convert( const QString &fileName )<br>
>If you have an ePub eBook with overflowing images (I tried a book from<br>
>O'Reilly) you can easily check it out. I included div tags because often<br>
images<br>
>are enclosed in one of them, sometimes with margins.<br>
>Best regards<br>
>Angelo (unplugged)<br>
><br>
>>----Messaggio originale----<br>
>>Da: <a href="mailto:aacid@kde.org">aacid@kde.org</a><br>
>>Data: 30-nov-<a href="tel:2012" value="+9722012">2012</a> 0.34<br>
>>A: <<a href="mailto:okular-devel@kde.org">okular-devel@kde.org</a>>, "<a href="mailto:insight.am@libero.it">insight.am@libero.it</a>"<<a href="mailto:insight.am@libero.it">insight.am@libero.it</a>><br>

>>Cc: <<a href="mailto:nakeee@gmail.com">nakeee@gmail.com</a>><br>
>>Ogg: Re: [Okular-devel] R: Re:  suggestion to improve ePub generator<br>
>><br>
>>El Dimecres, 28 de novembre de <a href="tel:2012" value="+9722012">2012</a>, a les 18:25:50, <a href="mailto:insight.am@libero.it">insight.am@libero.it</a><br>
va<br>
>>escriure:<br>
>>> Hi Ely,Css is part of the ePub standard, right, but there are no exact<br>
>rules<br>
>>> for images, that is, they are not necessarily forced into a certain<br>
layout.<br>
>>> So in ePub readers they are usually shrinked and become so little. The<br>
>>> Okular rendering is good and similar to a "real book" layout (like pdf)<br>
but<br>
>>> the images are overflowed, but it can be fixed according to me, as I<br>
>>> proposed. I think it's not bad to add some css rule, because the<br>
>>> QTextDocument will process them too. I know you are in charge of the ePub<br>
>>> generator so you can perform some experiments. I studied the ePub format<br>
so<br>
>>> what I know is at your disposal. Regards<br>
>><br>
>>Well, if you know how to code you can send your patch and then we'll have a<br>
>>look at it and see if it makes sense (i.e. it's a big hack) or not (i.e.<br>
>looks<br>
>>nice code :-)).<br>
>><br>
>>Cheers,<br>
>>  Albert<br>
>><br>
>>><br>
>>><br>
>>><br>
>>> ----Messaggio originale----<br>
>>><br>
>>> Da: <a href="mailto:nakeee@gmail.com">nakeee@gmail.com</a><br>
>>><br>
>>> Data: 28-nov-<a href="tel:2012" value="+9722012">2012</a> 18.08<br>
>>><br>
>>> A: "<a href="mailto:insight.am@libero.it">insight.am@libero.it</a>"<<a href="mailto:insight.am@libero.it">insight.am@libero.it</a>>, "Okular<br>
>>> development"<<a href="mailto:okular-devel@kde.org">okular-devel@kde.org</a>><br>
>>><br>
>>> Ogg: Re: [Okular-devel] suggestion to improve ePub generator<br>
>>><br>
>>><br>
>>><br>
>>> Hi<br>
>>> The css is part of the ePub standard. The way I see it there are two<br>
>>> options:<br>
>>><br>
>>> - There is a bug in QTextDocument and then it should be fixed<br>
>>> - There is a bug in the css of the ePub and then it should be handled in<br>
>the<br>
>>> book.<br>
>>><br>
>>><br>
>>> Either way I don't think we should mess with the CSS.<br>
>>> But this is just my humble opinion...<br>
>>><br>
>>> Ely<br>
>>><br>
>>> On Wed, Nov 28, <a href="tel:2012" value="+9722012">2012</a> at 6:53 PM, <a href="mailto:insight.am@libero.it">insight.am@libero.it</a> <insight.am@libero.<br>
>it><br>
>>> wrote:<br>
>>><br>
>>><br>
>>> Hello,<br>
>>><br>
>>> I would like to suggest a possible improvement of ePub generator. Whether<br>
>>> this idea is right or wrong I await your response, so please do not ignore<br>
>>> it. I see that when an ePub file is opened in Okular the images are<br>
>>> horizontally overflowed and sometimes vertically overflowed. If the HTML<br>
>>> text of the ePub is passed to QTextDocument then some css rules can be<br>
>>> easily added for images so they are not cropped when displayed on page. It<br>
>>> could be fulfilled by adding some strings in the right place. What do you<br>
>>> think about it?<br>
>>> Thank you for any response.<br>
>>><br>
>>><br>
>>><br>
>>> _______________________________________________<br>
>>><br>
>>> Okular-devel mailing list<br>
>>><br>
>>> <a href="mailto:Okular-devel@kde.org">Okular-devel@kde.org</a><br>
>>><br>
>>> <a href="https://mail.kde.org/mailman/listinfo/okular-devel" target="_blank">https://mail.kde.org/mailman/listinfo/okular-devel</a><br>
>><br>
><br>
><br>
<br>
<br>
_______________________________________________<br>
Okular-devel mailing list<br>
<a href="mailto:Okular-devel@kde.org">Okular-devel@kde.org</a><br>
<a href="https://mail.kde.org/mailman/listinfo/okular-devel" target="_blank">https://mail.kde.org/mailman/listinfo/okular-devel</a><br>
</blockquote></div><br></div>