While we're on the topic of programming, the DWF Technical Evangelist Team has some samples that are provided on an as-is basis. Other samples were provided by Autodesk discussion group participants. These samples sometimes take advantage of undocumented API calls that may change in future versions.
Create Your Own Application
- BatchDWF.zip
This C# sample allows you to batch publish DWF files from AutoCAD 2007. It was developed by John Schmier. - DWFStrings.zip
This C++ sample from Archana Naik shows how to work with text strings using the DWF Toolkit. - Form1.zip
This C# sample code demonstrates how to work with object nodes and collections. OBJECTNODES are available in the API of version 7.0. An interface named CONTENT has been introduced, and objects can be obtained from the CONTENT object. - List_URLs
This C++ sample code shows how to run through a DWF file, using the DWF Toolkit, to list the URLs in the DWF file. - unpack.zip
This small piece of code shows how to read and unpack the entities contained in a 2D stream inside a DWF file. - SimpleW3DStreamProcessor.zip
This C++ sample was omitted from the DWF Toolkit 7.2.1 distribution. It will make its return in an upcoming toolkit release. - VectorEditor.zip
This C++ sample is an MFC application that allows a user to sketch simple primitives and then save a DWF file.
Embed DWF Files into Applications
- 2dObjectSample.zip
This is an example of using JavaScript to build a list of properties from the objects located in a 2D DWF. In addition to the HTML page with JavaScript, the zip file includes the DWG file used, DWF, and Publish settings to get block data into the DWF as properties. - Brokk_demo.zip
This is an example of using hyperlinks in a web page to navigate to 3D views in a model. - Change object Highlight Color.zip
Discussion group participant, Raghavendra Shetty, created this JavaScript sample by integrating a color picker developed by Matt Kruse. - detectViewer.html
This JavaScript sample detects the presence of the Autodesk Design Review or the Autodesk DWF Viewer. - DWFGoogleMaps.zip
These JavaScript samples show integration of DWF with Google Maps. They require your own Google Map API key. - EnableDisableCommands.zip
This JavaScript samples shows how to enable or disable commands from the Autodesk DWF Viewer user interface. - frameset.zip
These HTML pages show how to work with DWF files in frames. - fullview.html
This JavaScript sample shows how to load a DWF in full view mode with an URL. - JavaScriptTransformPoint.zip
This JavaScript sample shows how to transform points from screen to drawing coordinates. - Linking 2D and 3D: dwf_materials_demo.zip
This JavaScript sample shows how to link 2D and 3D objects. It was featured on a "Through the Interface" blog article by Kean Walmsley. - MaximizeCanvas.htm
This JavaScript samples shows how to turn off all of the menu toolbars. This example demonstrates how to maximize the DWF canvas area for display of the design data. The right click menu is still available. This sample requires Autodesk DWF Viewer 7.0 or Autodesk Design Review 2007. - Object Highlight Sample.zip
This JavaScript sample shows how multiple objects can be selected and highlighted. - ObjectNameValueSearch.zip
This JavaScript samples shows how to select objects based on object properties. - People Finder Facilities Management
This ASP sample was presented by Brian Mathews and Brian Pene at Autodesk University 2005 and shows how to integrate floor plan DWF files with an employee database. - Viewer_API_test.zip
This VBscript and JavaScript sample shows some of the basic functions of working with the viewer API. - zoomtofit.html
This JavaScript sample shows how to load a DWF in an HTML file with an automatic zoom to fit.
Integrate Our ActiveX Controls
VB
- ADV_Collections.zip
This Visual Basic sample shows how to work with collections of the Autodesk DWF Viewer. It finds all of the URLs in a DWF file and lists them. - DWF Batch Printer 1.8.zip
This sample includes the Visual Basic source code for a batch printing application. - PrintBlackAndWhite.zip
This Visual Basic example demonstrates how to print in black and white. - PrintUtil.zip
This DLL facilitates the printing process from a VB application. Source for a sample C# program that uses the DLL is included. A newer version of the same DLL has been built with Visual Studio 2005: PrintUtil2.zip. - VB6 SimplePrint PrintEX example.zip
This Visual Basic sample shows how to interface to the Print function of the Autodesk DWF Viewer. A similar example, SimplePrint PrintEx.zip was created by Senior QA Engineer, Anand Iyer. - TransformPoint.zip
This Visual Basic application shows how to transform points from screen to drawing coordinates.
C++
- DetectDWFViewer.zip
This C++ sample code shows how to detect the presence of Autodesk DWF Viewer or Autodesk Design Review.
The ability to programmatically interface with the files and the applications that result are yet another way that DWF goes beyond the paper.