Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Image getting cut in epub picture book #9

Open
RenugaDevi opened this issue Mar 9, 2012 · 2 comments
Open

Image getting cut in epub picture book #9

RenugaDevi opened this issue Mar 9, 2012 · 2 comments

Comments

@RenugaDevi
Copy link

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

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

fngr commented Mar 5, 2013

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants