Package com.openinventor.hardcopy
Class SoToPDFAction
- java.lang.Object
-
- com.openinventor.inventor.Inventor
-
- com.openinventor.inventor.actions.SoAction
-
- com.openinventor.inventor.actions.SoCallbackAction
-
- com.openinventor.hardcopy.SoToU3DAction
-
- com.openinventor.hardcopy.SoToPDFAction
-
public class SoToPDFAction extends SoToU3DAction
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, preferSoToU3DAction
. U3D files can be used to import 3D models inside PDF files by advanced PDF editors.Limitations
- Inherits limitations of
SoToU3DAction
. Please read these carefully.
Use case
// setup the root scene graph to export SoSeparator root = new SoSeparator(); ... SoToPDFAction pdfAction = new SoToPDFAction(); boolean 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
- On some platforms, some third parties may encounter problems to load displaying an error message like: "IFXOSFileIterator.ProcessDir: error opening /usr/local/u3d/lib/Plugins/ No such file or directory". In such case, declare the environment variable U3D_LIBDIR (UNIX only) and set it with the path to the Open Inventor libraries ($OIVHOME/lib).
- Limitations are common to
SoToU3DAction
.
- See Also:
SoToU3DAction
- Inherits limitations of
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.openinventor.inventor.actions.SoCallbackAction
SoCallbackAction.Material, SoCallbackAction.Responses, SoCallbackAction.TextureImage
-
Nested classes/interfaces inherited from class com.openinventor.inventor.actions.SoAction
SoAction.AppliedCodes, SoAction.DistribModes, SoAction.PathCodes, SoAction.PathIndices
-
Nested classes/interfaces inherited from class com.openinventor.inventor.Inventor
Inventor.ConstructorCommand
-
-
Field Summary
-
Fields inherited from class com.openinventor.inventor.Inventor
VERBOSE_LEVEL, ZeroHandle
-
-
Constructor Summary
Constructors Constructor Description SoToPDFAction()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static void
enableElement(java.lang.Class<? extends Inventor> t, int stkIndex)
void
setLandscape(boolean enable)
[Optional] Changes the page orientation from portrait to landscape.void
setPassword(java.lang.String writePass)
Calls setPassword(writePass, (java.lang.String)null).void
setPassword(java.lang.String writePass, java.lang.String readPass)
[Optional] Set passwords to lock write & read access to the PDF file contents.void
setText(java.lang.String text)
[Optional] Add a text block into the output PDF file.void
setTitle(java.lang.String title)
[Optional] Set a title into the output PDF file.-
Methods inherited from class com.openinventor.hardcopy.SoToU3DAction
areDraggersExported, closeFile, forcePolygonalText3, isPolygonalText3Forced, openFile, setExportDraggers
-
Methods inherited from class com.openinventor.inventor.actions.SoCallbackAction
addLineSegmentCallback, addPointCallback, addPostCallback, addPostTailCallback, addPreCallback, addPreTailCallback, addTriangleCallback, getComplexity, getComplexityType, getCoordinate3, getCoordinate4, getCreaseAngle, getCurrentResponse, getDecimationPercentage, getDecimationType, getDrawStyle, getFaceType, getFocalDistance, getFontName, getFontRenderStyle, getFontSize, getLightAttenuation, getLightModel, getLinePattern, getLinePatternScaleFactor, getLineWidth, getMaterial, getMaterial, getMaterialBinding, getModelMatrix, getNormal, getNormalBinding, getNumCoordinates, getNumNormals, getNumProfileCoordinates, getNumTextureCoordinates, getPickStyle, getPointSize, getProfile, getProfileCoordinate2, getProfileCoordinate3, getProjectionMatrix, getShapeType, getSwitch, getTextureBlendColor, getTextureCoordinate2, getTextureCoordinate4, getTextureCoordinateBinding, getTextureFileName, getTextureImage, getTextureMatrix, getTextureModel, getTextureTransformNode, getTextureWrapS, getTextureWrapT, getTransparencyType, getUnits, getVertexOrdering, getViewingMatrix, getViewVolume, invokeLineSegmentCallbacks, invokePointCallbacks, invokePostCallbacks, invokePreCallbacks, invokeTriangleCallbacks, isCallbackAll, setCallbackAll, shouldGeneratePrimitives
-
Methods inherited from class com.openinventor.inventor.actions.SoAction
apply, apply, clearApplyResult, forwardTraversal, forwardTraversal, getContinueActionInBranchFlag, getCurPath, getDistribMode, getNodeAppliedTo, getOriginalPathListAppliedTo, getPathAppliedTo, getPathCode, getPathListAppliedTo, getPipeId, getSceneManager, getState, getWhatAppliedTo, hasTerminated, invalidateState, isBeingApplied, isLastPathListAppliedTo, isUsingAlternateRep, nullAction, postDelayedTraversal, preDelayedTraversal, resetContinueActionInBranchFlag, setPipeId, setSceneManager, setUpState, stopActionInBranch, traverse, useAlternateRep
-
Methods inherited from class com.openinventor.inventor.Inventor
dispose, getNativeResourceHandle
-
-
-
-
Method Detail
-
setPassword
public void setPassword(java.lang.String writePass)
Calls setPassword(writePass, (java.lang.String)null).
-
setText
public void setText(java.lang.String text)
[Optional] Add a text block into the output PDF file.
-
setTitle
public void setTitle(java.lang.String title)
[Optional] Set a title into the output PDF file.
-
setLandscape
public void setLandscape(boolean enable)
[Optional] Changes the page orientation from portrait to landscape.
-
setPassword
public void setPassword(java.lang.String writePass, java.lang.String 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.
-
enableElement
public static void enableElement(java.lang.Class<? extends Inventor> t, int stkIndex)
-
-