fedefrappi / AePubReader

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

pagination issue #7

Closed dineshprasanna closed 12 years ago

dineshprasanna commented 12 years ago

i am trying to load an epub file in chapter wise into the webview. I want to know the width of the screen.

For Example:

if the content have one and half page text means it returns the width to be as 768 but if the content have two full page text means it returns the width to be as 1536

my code is:

int totalWidth = [[webView stringByEvaluatingJavaScriptFromString:@"document.documentElement.scrollWidth"] intValue];

please help me.....

WebberLai commented 12 years ago

I found some answer , but I not try it

// get the width of your content [webview stringByEvaluatingJavaScriptFromString:@"document.getElementById('id_of_content_container').offsetWidth;"];

Did you set this webView.scalesPageToFit = YES; ???

dineshprasanna commented 12 years ago

Thanks Sir,I tried but it returns zero for scroll width, is there any other way to rectify it

dineshprasanna commented 12 years ago

now its working for me, thanks sir

fngr commented 11 years ago

The problem is that you call updatePagination in shouldRotate... this is incorrect, it has been called 2 times.

CHANGE THIS:

FOR THIS: