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
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
- 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:
-
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 -
Method Summary
Modifier and TypeMethodDescriptionstatic void
enableElement
(Class<? extends Inventor> t, int stkIndex) void
setLandscape
(boolean enable) [Optional] Changes the page orientation from portrait to landscape.void
setPassword
(String writePass) Calls setPassword(writePass, (java.lang.String)null).void
setPassword
(String writePass, String readPass) [Optional] Set passwords to lock write & read access to the PDF file contents.void
[Optional] Add a text block into the output PDF file.void
[Optional] Set a title into the output PDF file.Methods inherited from class com.openinventor.hardcopy.SoToU3DAction
areDraggersExported, closeFile, forcePolygonalText3, invokePostCallbacks, invokePreCallbacks, 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, 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
-
Constructor Details
-
SoToPDFAction
public SoToPDFAction()
-
-
Method Details
-
setPassword
Calls setPassword(writePass, (java.lang.String)null). -
setText
[Optional] Add a text block into the output PDF file. -
setTitle
[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
[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
-