Hi I am working on e-book application where the pages of the book are displayed as SVG files.as a part of my application functionality i should able to select text from the SVG files which are rendered as images on web view.can anbody suggest me a way to do this.Thanks in advance.
How do you display the SVG? I'd think you do that in WebView. In that case you'd have to provide the text as a separate layer using HTML elements as an "overlay" over the displayed SVG.
I don't think iOS/WebView lets you select text from a SVG through WebView.
but why do you say the svg is rendered as "image"?
if you load te .svg file in a UIWebView directly or via an HTML file which load the svg...
it should be able to load the "normal" menu with "copy", "select"...
if you need only the "copy" menuItem
just add this:
-(void)copy:(id)sender{
NSLog(#"COPY!!");
[super copy:sender];
}
in the UIViewController of your UIWebView.
It works for me for all the html pages and for a .svg files with some text inside it
(i mean that the text to copy is in "myFile.svg")
Related
I am working on a flutter app which generates PDF files in flutter using pdf library.I need to create a pdf file which has a table of contents. They should be linked with the actual content and should navigate to their respective pages when clicked on it. I couldn't find any documentation online for doing this using the pdf library. The PDF is going to be written to a file so PDF Viewers in flutter are not useful for me either. Can someone please help me out
can we use html code with dart like <a tag or something for internal navigation in PDF?
You can use Anchor and Link widgets from pdf/widgets.dart for internal navigation inside the generated PDF.
Just create an Anchor on the page to which you want to navigate to. You need to provide a name parameter for it and it should be unique.
Anchor(name:'my_anchor', child: any_child_widget);
You can now refer to that anchor from another page using Link widget.
Link(destination:'my_anchor',child: any_child_widget);
You can enclose any child within the Anchor and Link widget.
i need an example of launch_background.xml file in android folder that contains and image and (text)...basically my main problem is that i can't place text in this splash screen..so to be specific...i want to achieve splash screen that contains and image and under it there is some text...
i achieved the image preview with bitmap tag inside of an item tag
but no Textview tag can be placed inside layer-list tag :( (not showing)
i know that i can make the text as an svg file and place it in item tag..but i want to do it with TextView tag...so i can control it
any help would be much appreciated...thanks in advance.
Ok to give a solution to my own problem... at first I didn't like to place my text inside a separate .png file for the purpose of reducing the apk file size. I placed it inside an svg file for the size purpose but I couldn't place that text in svg beneath the centered image... unless by hardcoding values with the attributes: "android:gravity=center" "android:top=200dp" ...and I don't feel comfortable with hardcoded values... so I searched and found this package "flutter_native_splash" Flutter Native Splash.
Placed the desired image and beneath it the desired text and the package generated the appropriate image densities for the various screens containing the image and text...
I would like to be able to save the contents of a decorator panel into some sort of image format. Does anyone have an ideas of how i could either take a screen shot and save it or some how export a panel to an imae format?
Try using html2canvas. GWT Panel is just a html element with some javascript to handle the layout.
You can find html2canvas here: http://html2canvas.hertzen.com/
I am writing a app that has a UIWebView that displays a HTML5 page. I want to annotate some text on the web page and save it in SQLite database. The annotated text must be changed to a specific color as a visual effect.
Any suggestions that how can I select and get the text back in Objective-C?
You have two choices:
Parse the HTML5 document by hand
Inject Javascript into the page and walk the document. See Search and highlight text in UIWebView
i am trying to parse an xml blog found here: http://www.feed43.com/1515171705611023.xml
it has pictures within the text. I am able to parse the headers, the content and the link of the individual posts.
I, however, cannot get it to parse the paragraph spacing links within the text or images. all three of these are EXTREMELY important.
I am using this: http://github.com/mwaterfall/MWFeedParser with very few changes. most them having to do with appearances and the actual feed loaded as well as using a scroll view for the detail view instead of the table view shown.
note: it didnt load these things before I made changes either.
Can anyone help me?
What you are looking for is an html renderer, not an xml parser. On iPhone, that is WebKit, which can be used through UIWebView.
Extract the html embedded in the rss formatted xml and place it in a UIWebView using loadHTMLString. Usually, the baseURL will be the same as the rss source, without the filename.