Samples

The following is a list of code samples available to HOOPS Publish developers. These samples are short applications that demonstrate a specific functional topic. The source code for each sample is distributed as part of the HOOPS Publish package. The sample sources are located at <exchange_install_dir>/samples/publish/publishsource/. Before running each sample, you must first build it. Visual Studio project files are included.


In addition to the examples listed below, the HOOPS Publish package includes example 3D PDF files and example PDF templates that you can use in your own application.

AnimWorkinstruction

samples/publish/publishsource/AnimWorkinstruction

This sample demonstrates how to programmatically create an animation.


BillOfMaterial

samples/publish/publishsource/BillOfMaterial

This sample builds a PDF for a 'bill of material' which involves populating cells in a table that has been created from an Excel spreadsheet.


CreatePRCMarkup

samples/publish/publishsource/CreatePRCMarkup

This sample demonstrates how to easily create a PRC markup using the API. This sample is using a set of C++ classes wrapping the HOOPS Publish API.


DemoFunctionalities

samples/publish/publishsource/DemoFunctionalities

This sample creates a three page document which demonstrates populating combo boxes and list boxes, and responding to selection events using JavaScript.


HelloWorld

samples/publish/publishsource/HelloWorld

This is a basic sample which creates a simple 3D PDF programmatically without using a template.


ProductDescription

samples/publish/publishsource/ProductDescription

This sample builds a PDF to demonstrate the 'product description' use case. It demonstrates how to create multiple viewpoints and assign them to buttons in the PDF template, and how to use JavaScript to show and hide specific parts of the 3D model in response to button clicks in a PDF form.


PublishPRCCube

samples/publish/publishsource/PublishPRCCube

This sample application demonstrates how to create 3D data using the API for 3D data authoring, and publish it in a PDF document. It shows how to traverse the model once created to retrieve unique PDF ids to identify individual parts of the model for use with JavaScript actions.


ResultsReporting

samples/publish/publishsource/ResultsReporting

This sample demonstrates the creation of tables on a PDF page. Warning: this sample needs the free add-on TableToPDF to be installed. This sample also demonstrates the use of the links entities (entity to execute an action when clicking in a rectangle zone).


U3DWithAnimation

samples/publish/publishsource/U3DWithAnimation

This sample shows how to activate an animation in a U3D file with a button click in a PDF form, based on a supplied PDF template.


UserDefinedViews

samples/publish/publishsource/UserDefinedViews

This sample demonstrates programmatic creation of defined camera positions, rendering the image of the scene at those positions to images, and placing the images on buttons within the PDF template.


WorkInstruction

samples/publish/publishsource/WorkInstruction

This sample creates an example Work Instruction from a PDF template by populating text fields and adding JavaScript to buttons to set the camera position and model entity states (visibility and transform) based on viewpoint states stored in the source PRC file.