How to get html of EPUB by page in flutter? - flutter

I want to get the HTML content of an epub file by page. I tried epubx package but it's not working correctly. Has anyone managed to get HTML of an epub by page?

Try this package epub_parser
You can fetch html like the following
// Enumerating chapters
epubBook.Chapters.forEach((EpubChapter chapter) {
// HTML content of current chapter
String chapterHtmlContent = chapter.HtmlContent;
});

Related

How to render partial content of a website in Flutter?

I am new to Flutter and I would like to render a partial content from a website in my Flutter application. Imagine this as an example: I want to render the main content of this website: https://flutter.dev/. I could obtain this content by executing the javascript command: document.getElementsByClassName("container")[0] .
What do I have to do to display this content in an WebView inside my Flutter application?
Thank you
This answer demonstrates how to pass html content to a Webview plugin in Flutter.
In your case you dont need to read from a file as in that answer, just pass in the String that you obtain from whatever means you need to use.
The relevant part of that answers code for you is:
String fileText = await rootBundle.loadString('assets/help.html');
_controller.loadUrl( Uri.dataFromString(
fileText,
mimeType: 'text/html',
encoding: Encoding.getByName('utf-8')
).toString());
where in your case the fileText String is the html content that you got from somewhere.

Save content of UIWebView

I am working on an app and I need to save the content of UIWebView.
I currently Use stringByEvaluatingJavaScriptFromString:#"document.getElementsByTagName('html')[0].innerHTML"
to get the html of the UIWebView, but the problem with this method is that it does not save the full content of some webpages.
So my question is How do you save the full content of a webpage including images and css
I think there is already a thread about this topic here:
iphone uiwebview download complete page with CSS and Images
Hope that helps.

How can I view a PowerPoint in an ASP.NET application?

Does anyone have a PowerPoint viewer which I can embed in an ASP.NET Web App?
If you are using Silverlight you can use
http://pptx2silverlight.codeplex.com/
You can't directly embed a PPT/presentation to view. Instead you can try any converter that allows you to embed the PPT slide as images or some other format that the client browser can render to the user. There are few products like GroupDocs viewer or Doconut viewer that do this. You can give it a try.
You will have to convert the PowerPoint slides in the form, i.e. images or HTML pages, that can be embedded in your web page. You may try GroupDocs.Viewer for .NET that allows rendering the presentation slides into high-fidelity images (PNG/JPG) or the HTML pages. You can then embed the rendered pages into your web page to preview the slides. This is how you can render the slides:
Rendering as Image:
using GroupDocs.Viewer.Options;
// Set output path
string OutputPagePathFormat = Path.Combine("C:\\output", "page_{0}.png");
// Render document pages
using (Viewer viewer = new Viewer("C:\\sample.pptx"))
{
PngViewOptions options = new PngViewOptions(OutputPagePathFormat);
viewer.View(options);
// Rendered images will be saved in the D:\output\ directory.
}
Rendering as HTML:
using GroupDocs.Viewer.Options;
// The file path format
string OutputPagePathFormat = Path.Combine("C:\\output","page-{0}.html");
using (Viewer viewer = new Viewer("C:\\sample.pptx"))
{
HtmlViewOptions options = HtmlViewOptions.ForEmbeddedResources(OutputPagePathFormat);
viewer.View(options);
}
Disclosure: I work as a developer evangelist at GroupDocs.

Why isn't CSS being applied within my UIWebView?

When I try to display a local HTML page un a UIWebView, the CSS for that page is not being applied. However, when I load that same page in the regular Safari, it is. What could be causing this?
I assume you are using loadHTMLString to populate the content of the UIWebView? Is your CSS embedded in the HTML that you are loading into the view? If it references a file online, check that the URL file is the full path (not just the relative path).
If the CSS is referenced using a relative path it will work fine in the browser, but not in a UIWebView with statically loaded content.

how to show thumbnil image from youtube rss feed in iphone

I tried To Parse the response of the of the youtube RSS feed and displayed it in tableview...
I works fine except i can't fetch URL for the thumbnil image of the video from rss... It comes in description tag and inside description tag there is a whole div (html)... is there any simpler way example tutorial.....to fetch the thumbnil image from youtube rss...
Thanks
i have the same prob ,but have figured out with YOUtube API ,
make your feed url in this pattern
http://gdata.youtube.com/feeds/base/users/[INSERT USERNAME]/uploads
after in the generated xml there is a media:thumnail tag where u can used to display youtube thumnails images.
without using this format u will get a descr tag with div style image thumbnail quite hard to parse as it is a html part,
better try this,i have solved this using type of feed pattern