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
--
You received this message because you are subscribed to the Google Groups "Monocle" group.
To unsubscribe from this group and stop receiving emails from it, send an email to monocle-js+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
What do you mean by that? can you share an example? thank you and terribly sorry for the trouble.
What do you mean by that? can you share an example? thank you and terribly sorry for the trouble.
--
Oh I see, so there is no way for monocle to support PDF. Only Epub and HTML files.
this.getComponent = function (cmptId) { var path = 'file://' + appStorageRoot + this.components[cmptId]; if(this.layout == "fixed") {
// For PDF with images return '<p><center><img src="' + path + '"/></center></p>'; } else {
//ePubs var ajReq = new XMLHttpRequest(); ajReq.open("GET", path, false); ajReq.send(null); return ajReq.responseText; } };