SoToPDFAction Class Reference
[HardCopy]

HardCopy Class for exporting a scene graph to a PDF file. More...

#include <HardCopy/SoToPDFAction.h>

Inheritance diagram for SoToPDFAction:
SoToU3DAction SoCallbackAction SoAction SoTypedObject

List of all members.

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 ()

Detailed Description

HardCopy Class for exporting a scene graph to a PDF file.

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

SEE ALSO

SoToU3DAction.

See related examples:

PDFExport


Constructor & Destructor Documentation

SoToPDFAction::SoToPDFAction (  ) 
virtual SoToPDFAction::~SoToPDFAction (  )  [virtual]

Member Function Documentation

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  ) 

Set the PDF output file.

Returns false if an error has occured.

Reimplemented from SoToU3DAction.

SoNONUNICODE bool SoToPDFAction::openFile ( const char *  filename  ) 

Set the PDF output file.

Returns false if an error has occured.

Non Unicode List:
This function should not be used in a Unicode application.

Reimplemented from SoToU3DAction.

void SoToPDFAction::setLandscape ( const SbBool  enable  ) 

[Optional] Changes the page orientation from portrait to landscape.

void SoToPDFAction::setPassword ( const SbString writePass,
const SbString readPass = "" 
)

[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.

Non Unicode List:
This function should not be used in a Unicode application.
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.

Non Unicode List:
This function should not be used in a Unicode application.
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.

Non Unicode List:
This function should not be used in a Unicode application.

The documentation for this class was generated from the following file:

Open Inventor Toolkit reference manual, generated on 17 Dec 2019
Copyright © Thermo Fisher Scientific All rights reserved.
http://www.openinventor.com/