Class for exporting a scene graph to a PDF file. More...
#include <HardCopy/SoToPDFAction.h>
Public Member Functions | |
virtual SoType | getTypeId () const |
SoToPDFAction () | |
virtual | ~SoToPDFAction () |
SoNONUNICODE bool | openFile (const char *filename) |
bool | openFile (const SbString &filename) |
bool | closeFile () |
SoNONUNICODE void | setPassword (const char *writePass, const char *readPass=NULL) |
void | setPassword (const SbString &writePass, const SbString &readPass="") |
SoNONUNICODE void | setTitle (const char *title) |
void | setTitle (const SbString &title) |
SoNONUNICODE void | setText (const char *text) |
void | setText (const SbString &text) |
void | setLandscape (const SbBool enable) |
Static Public Member Functions | |
static SoType | getClassTypeId () |
This class can export an Open Inventor scenegraph into a simple PDF file. In addition to 3D scene encapsulation, the exporter can insert a title to the document and an unique block of text. Moreover, PDF encryption can lock access to the file contents. To import a 3D model inside a more complex PDF file, prefer SoToU3DAction. U3D files can be used to import 3D models inside PDF files by advanced PDF editors.
Limitations
Use case
SoHardCopy::init(); ... // setup the root scene graph to export SoSeparator* root = new SoSeparator; ... 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 }
Warning
SoToPDFAction::SoToPDFAction | ( | ) |
virtual SoToPDFAction::~SoToPDFAction | ( | ) | [virtual] |
bool SoToPDFAction::closeFile | ( | ) |
finalize export to the U3D output file.
Returns false if an error has occured.
Reimplemented from SoToU3DAction.
static SoType SoToPDFAction::getClassTypeId | ( | ) | [static] |
Returns the type identifier for this class.
Reimplemented from SoToU3DAction.
virtual SoType SoToPDFAction::getTypeId | ( | ) | const [virtual] |
Returns the type identifier for this specific instance.
Reimplemented from SoToU3DAction.
bool SoToPDFAction::openFile | ( | const SbString & | filename | ) |
SoNONUNICODE bool SoToPDFAction::openFile | ( | const char * | filename | ) |
Set the PDF output file.
Returns false if an error has occured.
Reimplemented from SoToU3DAction.
void SoToPDFAction::setLandscape | ( | const SbBool | enable | ) |
[Optional] Changes the page orientation from portrait to landscape.
[Optional] Set passwords to lock write & read access to the PDF file contents.
Passwords are optional. A write password is required before setting a read password. Write and read passwords must be different.
SoNONUNICODE void SoToPDFAction::setPassword | ( | const char * | writePass, | |
const char * | readPass = NULL | |||
) |
[Optional] Set passwords to lock write & read access to the PDF file contents.
Passwords are optional. A write password is required before setting a read password. Write and read passwords must be different.
void SoToPDFAction::setText | ( | const SbString & | text | ) |
[Optional] Add a text block into the output PDF file.
SoNONUNICODE void SoToPDFAction::setText | ( | const char * | text | ) |
[Optional] Add a text block into the output PDF file.
void SoToPDFAction::setTitle | ( | const SbString & | title | ) |
[Optional] Set a title into the output PDF file.
SoNONUNICODE void SoToPDFAction::setTitle | ( | const char * | title | ) |
[Optional] Set a title into the output PDF file.