Open Inventor Release 2024.2.0
 
Loading...
Searching...
No Matches
Simple approach

The class SoToPDFAction exports an Open Inventor scene graph directly into a simple PDF file. SoToPDFAction can also set the document title, specify the text of the document, and lock access to the file content.

Example : Generation of PDF3D output

SoSeparator* root = ... // scenegraph init
SoToPDFAction pdfAction;
bool result = pdfAction.openFile( "output.pdf" );
if ( !result )
... // error management
pdfAction.setTitle( "Scene Name" );
pdfAction.setText( "Some text describing the exported scene." );
pdfAction.apply( root );
result = pdfAction.closeFile();
if ( !result )
... // error management

The sample demo $OIVHOME/src/HardCopy/PDFExport shows how to convert an Open Inventor file. This demo brings up the dialog box shown below. Fill in a few fields and click on the Export button.

Open Inventor to PDF3D conversion tool.

the Open Inventor input filename. The second (optional) argument is the output PDF filename. For example:

PDFExport harley.iv output.pdf

Harley.iv exported to PDF3D view.