Using freewheel.labs.autoscaling .com to auto generate preview images of DwF files on your web site

Source: Internet
Author: User

Http://dwf.blogs.com/beyond_the_paper/2006/09/using_dwfitcom_.html

Problem:
You have a web page containing into links to DwF files and you want to create thumbnail images for each file listed but you don't want to open each DwF file and generate preview images manually. that cocould be quite time consuming. also, you want your users to view your DwF files on Mac or windows without your Users Installing any software, so they can simply click and view.

Solution:
Software Engineer and evangelist,Brian Pene, Notes that you can use freewheel.labs.autoscaling .com DwF-to-PNG [dwfimage. aspx] and interactive DwF viewing web service [DwF. aspx]!

Example-prefixing your src tag attribute with dwfImage. aspx service and your <a> href tag attribute to use the dwf. aspx service.

We will use this following DwF file for our example: http://freewheel.labs.autodesk.com/sample/Hotel5.dwf

Using the DwF to PNG Rendering Service [http://freewheel.labs.autodesk.com/dwfImage.aspx], the following URL will render a PNG small enough to fit on most cell phone screens. it will view the center of page 1 of the drawing 5.dwf zoomed in to a factor of 1 and generate a PNG image that is 200x200 pixels:

Http://freewheel.labs.autodesk.com/dwfImage.aspx? Cx = 0.5 & Cy = 0.5 & scale = 1 & page = 1 & width = 200 & Height = 200
& Path = http://freewheel.labs.autodesk.com/sample/Hotel5.dwf

Below is an explanation of the parameters (in red) accepted by the DWF-to-PNG web service:

  • & Amp; cx = <float> A number from 0.0 to 1.0 for the view's Center in X.
  • & Cy = <float> A number from 0.0 to 1.0 for the view's Center in Y.
  • & Scale = <float> A number in the range 1.0 to 16384.0 for the view's Scale.
  • & Page = <integer> An integer from 1 to "N" for the page number to view.
  • & Width = <integer> The horizontal size of the PNG to produce (in pixels ).
  • & Height = <integer> The vertical size of the PNG to produce (in pixels ).
  • & Path = <URL> An URL path to a DWF to be viewed.

If you set the URL string above as the src attribute of an image tag like so:

Path = http://freewheel.labs.autoapps.com/sample/4255.dwf” width = "200" height = "200" border = "1">

This will result in the following image.

Using the same DwF File URL, we can also prefix the href attribute of the <A> tag so we use the DwF viewing web service and then set the Path = parameter to be that of the DwF file we want to view:

<A href = "http://freewheel.labs.autodesk.com/dwf.aspx? Path = http://freewheel.labs.autodesk.com/sample/Hotel5.dwf "> [image tag here] </a>

If we set this around und our image tag above, we get the following result (click the image to view the file without installing any software !) :

Thanks for the info Brian!

For the latest information on project freewheel, see Scott Sheppard's It's alive in the lab blog.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.