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

Cannot read property 'onLastPageOfBook' of null on using PDF file #249

Open
rebbieboi opened this issue Jun 4, 2014 · 1 comment
Open

Comments

@rebbieboi
Copy link

I am new to monocle and was asked to use your api for reading PDF, EPUB and HTML ebooks, So far I have succeeded in Epub and HTML. but for PDF i get that error above.

I use this code:

var bookData = {
getComponents: function () {
return [
'1.pdf'
];
},
getContents: function () {
return [
{title: "1", src: '1.pdf'}
]
},
getComponent: function (componentId) {
return {url:componentId};
},
getMetaData: function(key) {
return {
title: "Test documents",
creator: "Aron Woost"
}[key];
}
}

        Monocle.Events.listen(
            window,
            'load',
            function () {
                window.reader = Monocle.Reader('reader', bookData);
            }
        );  

What am i doing wrong here?

Thank you

@AbhilashThomas
Copy link

Hi, I don't think this would work as you are just passing the 1.pdf for the iframe URL which may be then rendered by the browser using the embed tag, atleast on chrome, instead of any actual HTML. If you can extract the PDF text and then pass it, you may have success.But then you may loose formatting and all that... Apart from the error , what do you see in the monocle container?

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

2 participants