fedefrappi / AePubReader

Another ePub Reader for iPad
-
369 stars 150 forks source link

Image getting cut in epub picture book #9

Open RenugaDevi opened 12 years ago

RenugaDevi commented 12 years ago

Hi All,

If .epub files having image means(picture book) it's getting cut and the remaining image shown in another page..

How to resolve this issue?

Thank You

WebberLai commented 12 years ago

There is no good way to fix it , but you can try to adjust the all image size in webview .

Or you can turn the webview into scroll mode , but you will not see the page number , or the page number will be wrong.

fngr commented 11 years ago

Add this on Chapter.m in webViewDidFinishLoad

int heightBefore = [[webView stringByEvaluatingJavaScriptFromString:@"document.body.scrollHeight"] intValue];

NSString *imagesRule = [NSString stringWithFormat:@"addCSSRule('img', 'max-height: %fpx;')",webView.frame.size.height-10];
[webView stringByEvaluatingJavaScriptFromString:imagesRule];

int heightAfter = [[webView stringByEvaluatingJavaScriptFromString:@"document.body.scrollHeight"] intValue];

if(heightAfter!=heightBefore)
    heightChanged = YES;

And at the botom

if(heightChanged) pageCount--;