How can I mash-up ThinkFree Viewer with my web services?

When you publish office documents to your web site, such as a blog or company home page, you don't need to convert anything to HTML, we do it for you. Your visitors do not need to install any office suite applications. Just link the file to ThinkFree Viewer. ThinkFree Viewer will automatically convert your office document to HTML and allow users to view the document directly in their browser.

Sometimes converting the document into HTML may take some time, so you have the option to "pre-convert" your document (see the "action" parameter). When documents are linked using ThinkFree Viewer, documents can also be published to our free ThinkFree Docs service if desired. The document sharing space can be used to publicize your document and thus your website. For more information about license requirements, see our Terms of Use.

View examples of documents published using ThinkFree Viewer API

1. HTML View

1. Upload your document (in this case we are using the file named "Mortgage Sample.xls") to your web server
2. Link your document following the example of the link below.
http://viewer.thinkfree.com/html?url=http%3A%2F%2Fviewer.thinkfree.com%2FMortgageSample.xls&action=view

PARAMETER DESCRIPTION VALUE NOTE
url UTF-8 encoded URL of document to open e.g) http://viewer.thinkfree.com/MortgageSample.xls REQUIRED
action View
Request pre-conversion
view
convert
REQUIRED
pageurl UTF-8 encoded URL of original website or blog where document has been published e.g) http://myblog.blogspot.com/myexample_new_test_thinkfreepost OPTIONAL


2. Applet Parameters

While W3C recommends using the OBJECT tag over the APPLET tag (read http://www.w3.org/TR/html4/struct/objects.html#h-13.4), Sun Microsystems recommends using APPLET tag for Web pages accessible over the Internet (read http://java.sun.com/j2se/1.5.0/docs/guide/plugin/developer_guide/using_tags.html). Don't worry. ThinkFree APIs works fine either way.

PARAMETER DESCRIPTION VALUE NOTE
codebase Where to get JAR file of Applet http://online.thinkfree.com/codebase/ REQUIRED
FIXED
archive JAR file containing APPLET class loader.jar REQUIRED
FIXED
code Name of main class for APPLET com.tf.applet.loader.LoaderApplet REQUIRED
FIXED
width Width of APPLET e.g) 400, 400px, 90% REQUIRED
height Height of APPLET e.g) 400, 400px, 90% REQUIRED
document-url UTF-8 encoded URL of document to open e.g) http://viewer.thinkfree.com/MortgageSample.xls REQUIRED
app ID of APPLET to call and run WRITE_VIEWER
CALC_VIEWER
SHOW_VIEWER
REQUIRED
autostart Runs APPLET automatically
When set to FALSE, user must click the splash screen to load applet
TRUE
FALSE(default)
OPTIONAL
Example:
 



















3. JSP Parameters

The URL parameter for the JSP code is http://viewer.thinkfree.com/view.jsp. You need to add the URL of document to open along with the APPLET ID. You can also specify the size of the applet in the browser window.

Please note that the resulting parameter must be a URL, which means every argument should be encoded together in a single string to make one URL.
PARAMETER DESCRIPTION VALUE NOTE
open UTF-8 encoded URL of document to open e.g) http://viewer.thinkfree.com/MortgageSample.xls REQUIRED
app ID of APPLET to call and run WRITE_VIEWER
CALC_VIEWER
SHOW_VIEWER
REQUIRED
width Width of APPLET e.g) 400, 400px, 90% OPTIONAL
height Height of APPLET e.g) 400, 400px, 90% OPTIONAL
Example:
http://viewer.thinkfree.com/view.jsp?open=http%3A%2F%2Fviewer.thinkfree.com%2FMortgageSample.xls &app=CALC_VIEWER

4. Applet Parameters vs. JSP Parameters

ThinkFree APIs provide two methods: <APPLET> tag and JSP arguments
APPLET tag arguments: If you have the privileges required to edit the HTML code of a web page, you can insert the applet into your HTML page through <APPLET> or <OBJECT> tags.
JSP arguments: Passing arguments using JSP and URL parameters lets you use Viewer without having to modify the HTML or page layout.
If you are interested in a deeper level of integration with ThinkFree, please contact This e-mail address is being protected from spambots, you need JavaScript enabled to view it .'; document.write( '' ); document.write( addy_text75455 ); document.write( '<\/a>' ); //-->\n This e-mail address is being protected from spambots, you need JavaScript enabled to view it
 
Contact Us