How to use font awesome with ABCpdf 11 - abcpdf

webSupergood recently announced that with ABCpdf 11 they are now officially supporting Font-Awesome. Is there any example on how to use that?
As of today, the link at the feature list page only redirects to the Font Awesome page.
I would merely like to add a Font-Awesome icon to my document, no need to render any external page.

Font Awesome is supported by the new ABCChrome HTML engine in ABCpdf 11 - and the default settings are the ABCChrome engine with JavaScript enabled. You can convert a URL (including a "file://" URI) using Doc.AddImageUrl, or an HTML string with Doc.AddImageHtml. And the Paged HTML Example applies for HTML that may take up more than one PDF page.
If there is any latency/delay in accessing web fonts, you can make ABCpdf wait e.g.
doc.HtmlOptions.RepaintDelay = 2000;
doc.HtmlOptions.RepaintTimeout = 5000; // default
int htmlID = doc.AddImageUrl(theURL);

Related

Maintaining image preview in Netlify CMS

When uploading an image in Netlify CMS, I get a preview image, which however disappears right after a refresh. The image I attached shows the source attribute the preview element uses - it looks like the logic here assumes that the image is already deployed to the same domain (which in turn assumes that the site the CMS manages lives on the same domain as the CMS interface itself). Is there a way to change the base URL just for the preview, e.g. to some kind of https://rawgit/...-like URL. I am looking for a setting that affects only the preview widget behavior and nothing else (where the image is saved, what URL path it adds in the post frontmatter etc).
Thanks in advance for any pointers!

UIWebView ... What HTML format is required?

I'm loading blog posts from a SQL database into a UIWebView. The posts aren't rendering correctly. I went into the database. The data does have html tags, but not <html> <body>
Do I have to inject these tags to get data to render?
The docs state that UIWebView can display "HTML content", by which I assume it means valid HTML content.
I would ensure that the HTML document you are trying to display is able to display in Safari or some other browser.
Note, as suggested in Apple's UIWebView doc that since iOS 8, WKWebView is preferred for new development:
NOTE
In apps that run in iOS 8 and later, use the WKWebView class instead
of using UIWebView. Additionally, consider setting the WKPreferences
property javaScriptEnabled to NO if you render files that are not
supposed to run JavaScript.

Image in Memory as div background-image

I'm doing all of this in a DotNetNuke module.
I have some images that I load from a database as byte data. Originally, I was converting the byte data to a Drawing.Image, resizing it, then converting it back to a byte before doing a Response.BinaryWrite. This was all taking a place in .aspx.
Meanwhile, in the View.ascx I create a div in the code as part of a jquery and had the background-image point to the url of previously mentioned .aspx. I had passed in a parameter within the url string to get different images and this all worked fine.
However, here's the problem; I learned that using a .aspx within a DNN module can create a security issue among other problems. Therefore, I'm now looking for alternatives for displaying the images as a background within the div tag.
Is there a way to load the image into memory and set the div's background to that memory image and will that work across the latest versions of IE7, IE8, IE9, Firefox, and Chrome? I'm open to other alternatives and suggestions
As long as you are validating the users access to the resource, there is no security risk with doing this.

How to parse HTML page data in Windows Phone 7?

I want to do the below two tasks In Windows Phone 7 application.
1.Navigate to a web page (e.g.http://www.FlightsInd.com) and get the HTML page data.I wnat to ensure that all the Document data is completely downloaded.
In C#.Net i am doing this using below code:
WebBrowser objWB = new WebBrowser();
webBrowser1.DocumentCompleted += new WebBrowserDocumentCompletedEventHandler(webBrowser1_DocumentCompleted);
objWB.Navigate("http://www.FlightsInd.com")
here once the DocumentCompleted event is fired it means all the data in that request is downloaded.
2.Parse HTML page elements data.
In C#.Net i am doing this using below code.
doc = webBrowser1.Document;
btnElem = doc.GetElementById(streleid);
Can anyody help me with the equivalent classes/code for the above two implementations ?
Use WebBrowser Windows Phone control
To Navigate to your page
browser.Navigate(new Uri("http://www.FlightsInd.com"));
To understand that navigation completed and content is loaded
WebBrowser.Navigated Event
WebBrowser.LoadCompleted Event - Occurs after the WebBrowser control has loaded content.
WebBrowser.NavigationFailed Event - to track navigation failures
The WebBrowser class events are raised in the following order: Navigating, Navigated, and LoadCompleted.
To get Html source
WebBrowser Windows Phone control contains special function to save the source for the HTML content currently displayed in WebBrowser control as a string:
string html = browser.SaveToString();
To parse Html
Look at HTML Agility Pack
What is the best way to parse html in C#?
Parsing HTML String
PS. Alternatively you can use webBrowser.InvokeScript (C#) with combination of js eval to invoke any js command which can use window.external.notify inside it to pass results back to C#.
If I get your question right, you can use web browser isBusy property to track if its still downloading data and sleep while its still busy.
For parsing html document you can use NSoup library to parse the html just like jQuery. Its a port from java's JSoup library.
http://www.developerfusion.com/project/98472/nsoup/
Syntax explained here:
http://jsoup.org/cookbook/extracting-data/selector-syntax
If you own the webpage you are navigating to, you can use window.external.notify(document.documentElement.innerHTML) in your javascript to pass the document html to native layer. Then you would catch the value in your native code using ScriptNotify.
A little more complex, but if you don't own the webpage, you could host your own webpage, open an iframe with the original page, and get the html from the iframe.
See here for more info on window.external.notify: http://msdn.microsoft.com/en-us/library/system.windows.controls.webbrowser.scriptnotify(v=vs.95).aspx

How to bind html content

I'm new to windows phone application development.currently i'm doing xml reader project.in my project display the xml description content.i used textblock to display the content.but HTML tag not supported.please help alternative for textblock.how to bind
If you have HTML content, the most appropriate tool for viewing it is a WebBrowser control. This will render arbitrary HTML, it will also fetch images over HTTP etc ...

Resources