AePubReader icon indicating copy to clipboard operation
AePubReader copied to clipboard

Image getting cut in epub picture book

Open RenugaDevi opened this issue 13 years ago • 2 comments

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

RenugaDevi avatar Mar 09 '12 05:03 RenugaDevi

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.

WebberLai avatar Apr 20 '12 10:04 WebberLai

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

fngr avatar Mar 05 '13 10:03 fngr