Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

LIT or EPUB eBook in-a-window support?
Started by troylyndon Jan 12 2019 08:09 AM

4 replies to this topic
[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

troylyndon

[GLOBAL: userInfoPane.html]
troylyndon
  • Contributor

  • 564 posts
  • Corona SDK

Does anyone know how I can display LIT or EPUB eBook files within Corona, either natively or via a plugin?

 

I'm working on a new project that requires me to open eBook files, but I don't want to require the user to leave my app to open another eBook reader. I'd like to keep the eBook display within a window of my app, similar to how webView works.

 

Any help is very much appreciated.



[TOPIC: post.html]
#2

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 25,373 posts
  • Enterprise

Hi Troy.

 

I'm unaware of any plugins to process these files. We certainly don't have any internal API's to process them. EPUB probably has a standardized format. There may be a Lua library out there that can help. I would suggest heading to Google or the search engine of your choice and see what you can find.

 

You could also post a job request to get a community developer to build a plugin if there are some standard C++/iOS or Android SDK's that could be incorporated within reason.

 

But since I don't know what the format is about, if it's just text and images, it's likely possible, but if those formats contain any interactivity, the complexity of such a plugin would be considerably more difficult.

 

Rob



[TOPIC: post.html]
#3

troylyndon

[GLOBAL: userInfoPane.html]
troylyndon
  • Contributor

  • 564 posts
  • Corona SDK

@Rob, thank you for the response. FYI, https://en.wikipedia.org/wiki/EPUB

Do you know of ANY eBook format that Corona SDK has support for, whether or not a plugin?



[TOPIC: post.html]
#4

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 25,373 posts
  • Enterprise

A quick read through that I see couple of hiccups, but I also don't see things as being horribly impossible.

 

EPUB is basically HTML and some XML. There is an XML parser in our Business App sample. It's not perfect, but it will work in many cases. HTML is basically XML, so it should be able to parse an HTML document into a Lua table.

 

It seems to support several image formats. Corona will support JPEG and PNG. There is a plugin to handle GIF in the marketplace and we have the Nano SVG plugin to attempt to handle the SVG requirements. However the Nano SVG plugin only has limited support for some SVG file.

 

Where you will run into some potential headaches, is the HTML side. It tends to want to support CSS (and maybe JavaScript) and you can't do HTML style text with display.newText(). But this is something where you could write the HTML, CSS and any JS files out to your local storage and have a native.newWebView() show the content.

 

Rob



[TOPIC: post.html]
#5

troylyndon

[GLOBAL: userInfoPane.html]
troylyndon
  • Contributor

  • 564 posts
  • Corona SDK

@Rob, ah, excellent info. Thank you :)




[topic_controls]
[/topic_controls]