Using Images In SWT Browser Component - eclipse

Whats the best way of using images in SWT Browser component. Currently i stream the images to temp folder and use their location for displaying them. Is there any better way of using these images in the SWT Browser component, particulary images from the platform plugins.
Best Regards,
Keshav

Convert them to a DataURI and insert them into the HTML directly.
http://en.wikipedia.org/wiki/Data_URI_scheme

If your plug-in is directory-based - rather than jar-based - you can use the files in the plug-in directly. The are several ways to find the file name of an resource entry of a bundle - I prefer FileLocator.toFileURL(URL) which converts an URL on the format platform:/<plugin>/<path> to a file:<filename>... exactly what you need.

Related

Plone: TinyMCE upload files

I'm trying to find a solution for files uploading directly with TinyMCE. Imagine creating a list of pdf files by uploading them using a custom button.
Is there something already done I can use? collective.clipboardupload seems to be a solution only for images.
collective.quickupload serves us well for such purposes and has a very good UI.
You can add that gadget as a portlet and make it only visible in edit-mode via CSS.
In our case we assigned the portlet to a certain content-type ('Gallery') instead to a location.
MoxieManager may be what you're looking for. It's a premium plugin made by the same developers as TinyMCE itself.
https://www.tinymce.com/docs/enterprise/manage-files-and-images/
Try to use reponsive file manager :
http://www.responsivefilemanager.com/

Reusing content of an external webpage in DITA-OT

I tried different method to include the content of an external webpage by url in dita files without success. Is it possible to do it? I can add references to my dita files:
<related-links>
<link href="http://example.com" format="html" scope="external"/>
</related-links>
however I am not able to ddisplay the content of the page in oXygen.
tl;dr: It depends on the external sources and on your publication targets. If you want to publish to PDF, your content needs to be available offline.
What do you exactly mean with content? You can use external sources, e.g. images, if you just publish to html5. Just use the image URL in the href. If you publish to pdf, it would not work. The DITA-OT does not download things for you. Most websites are dynamic, so content is not very static so it may not work as you might expect. Maybe the external website has an API to gather the data you need. Or maybe it would be safer to use the depend.preprocess.pre extension point to hook in an Ant Target to download the external sources via <get> or curl. Another approach would be dita-glass for on-the-fly conversion. But, it depends...

FreeTypeFontGenerator for GWT

I'm using Libgdx to write an Android and HTML5 app. I have found out that FreeTypeFontGenerator doesn't work for a GWT application and truetype is deprecated. What shall I use if I want to use fonts in a GWT application?
You use BitmapFont just like you do in any LibGDX application, it is the standard mechanism to support fonts in LibGDX. FreeTypeFontGenerator is an extension that doesn't work for GWT because it features native code. If you need to pre-generate some new font files of different sizes and types you can use Hiero or my favorite BMFont.
There might be some better way, but if you can't find any, you can prerender the font in a few sizes with the Hiero tool built into the gdx-tools project, and choose the most fitting one at runtime. Hiero generates a .png and a file describing the characters in that image which you can simply load, e.g.:
BitmapFont font = new BitmapFont(Gdx.files.internal("data/font/font"+sizeNum+".fnt"));

What's the best way to download multiple images and display multiple UIImageView?

I need to download images from a website and display them on(?) multiple UIImageView.
Maybe I'll code a php to "read" the directory and search for images, write a XML file and use it as medium. But I'm not sure if it's the best way.
Let's see the options you have to fetch images from a website:
Fetching HTML and Parsing the HTML to find the images (on the iphone). Then downloading the images.
Writing a script (maybe PHP) that writes all image links to an XML file (or JSON), and then fetch the output of your script with all the links.
If you choose option (1) you'll need NSURLConnection to fetch data asynchronously (without blocking the UI). I would also use TFHpple to parse HTML using xpath queries, see this tutorial for help. Finally to fetch the images using their URLs you can use SDWebImage, SDWebimage also provides caching so your app will not download the same image multiple times.
The bad side of using option (1) is that any change in the Website you're getting the images from will break your app and you'll need to issue an update to the app store in order to fix it.
If you choose option (2), your app will be easier to fix if the website changes, you'll just need to modify your script.
If you go with option (2) you'll probably need NSURLConnection, NSXMLParser (or a third party XML parsing library) and to download the images I would recomend SDWebImage again. I would also advise using JSON (and NSJSONSerialization) instead of XML, just beacuse I find JSON easier to parse.
Yes, it will be very good if you write some php script to get image list (list of image urls).
After getting such urls you can asynchronously download and show them in image views. Look here for such async image view implementation

Is there a way to programmatically download a web page, for offline viewing, using WebKit?

What I'd like to be able to do is download any web page, and be able to view it offline.
It seems like html WebKit views cannot be converted to PDFs (on the Mac, you could 'print' a PDF, but that isn't possible on iPhone?).
So, the only way is to save the actual resources - save the html, the step thru each image, css, js file and save it locally. Then maybe alter the urls within the code so they point to the right place...etc ...etc...
Is there a standard way to do this?
Or, is there an open source project (in any programming lang) which does this kind of thing?
There's an excellent webkit html to pdf converter appropriately called wkhtmltopdf. Given the reources available on the iphone and its toolkits, I think it'd be easy to compile a version for the i-Phone ('think' being the operative word). We've managed to use the tool in a Windows, Linux and Solaris environment with absolutely no bugs. Here's the link:
http://code.google.com/p/wkhtmltopdf/