Render content without iframe
Hi all, i've a question. It's possible to render the content, without the iframe ?
Use view: inline option.
Maybe it works. look here
Use
view: inlineoption. Maybe it works. look here
I'm getting error when using anything else than iframe
this.View is not a constructor
From what I can tell, view: 'iframe' gets a special treatment (in Rendition class). Everything else has to be passed in as the actual class instead of a string. So you may do an import InlineView from 'epubjs/lib/managers/views/inline' and then pass that class as the view option directly.
@unsyn - Would it be possible to make and share a working example of this?
Looks like InlineView is not available from the typescript bindings.
@burtonator It seems that most type definition and document are outdated, //@ts-ignore is the only solution to survive maybe.
@burtonator
create a file name epub-reader.d.ts:
declare module 'epubjs/lib/managers/views/inline' {
export default class InlineView {}
}
InlineView has error anyway (TypeError: view.offset is not a function).
import InlineView from 'epubjs/lib/managers/views/inline';
const opt = {
...
view: InlineView,
}
InlineView has error anyway (
TypeError: view.offset is not a function).import InlineView from 'epubjs/lib/managers/views/inline'; const opt = { ... view: InlineView, }
same as @Losses answer, its just avoiding Typescript. not really a solution.