webPDF 8: Operation Outline, Part 4: Additional ActionTypes
Minimum Technical Requirements
- Java version: 8
- webPDF version: 8
- wsclient version: 2
Additional ActionTypes
Because the information about the Outline webservice operation is extensive, we published it in four parts. This article continues Operation Outline Part 3.
The following parameters and subelements can be selected for a setOCGState action.
The layerState Object
This object selects layers in the document and determines the logic according to which layer visibility should be changed.
SetOCGStateActionType.LayerState layerState = new SetOCGStateActionType.LayerState();
setOCGState.getLayerState().add(layerState);
The following parameters can be set on the layerState object.
state (default value: "ON")
The status changes to be applied to the layers.
ON= The layers should be shown.OFF= The layers should be hidden.TOGGLE= The visibility of the layers should be toggled.
layerState.setState(OCGStateType.TOGGLE);
The referencedLayer Object
This object selects a layer in the document by its name.
OCGSelectionType layerSelection = new OCGSelectionType();
layerState.getReferencedLayer().add(layerSelection);
The following parameters can be set on the layerSelection object.
name (default value: "")
The name of the layer to be selected.
layerSelection.setName("LayerName");
transition ActionType
When the element is selected, this action displays the visual changes caused by other actions using the animation defined here.
TransitionActionType transitionAction = new TransitionActionType();
firstPage.getActions().add(transitionAction);
The following parameters and subelements can be selected for a transition action.
scaling (default value: "100")
Defines the percentage scaling value applied during the animation.
transitionAction.setScaling(50);
effectDimensionHorizontal (default value: "true")
Defines the axis along which split and blind effects are executed. If this value is set to true, the animation runs along the horizontal axis; otherwise, it runs along the vertical axis.
transitionAction.setEffectDimensionHorizontal(false);
motionInward (default value: "true")
Defines for split, box, and fly animations whether the animation should move toward the center of the page (true) or toward the page edges (false).
transitionAction.setMotionInward(false);
flyAreaOpaque (default value: "false")
Defines for fly animations whether the incoming content layer should initially be opaque.
transitionAction.setFlyAreaOpaque(true);
flyScale (default value: "100")
Defines the initial scaling factor of the incoming content layer as a percentage for fly animations.
transitionAction.setFlyScale(40);
direction (default value: "leftToRight")
Defines the animation direction.
LEFT_TO_RIGHT= From left to right.BOTTOM_TO_TOP= From bottom to top.RIGHT_TO_LEFT= From right to left.TOP_TO_BOTTOM= From top to bottom.TOP_LEFT_TO_BOTTOM_RIGHT= From top left to bottom right.NONE= Use the default value for the animation.
transitionAction.setDirection(OutlineTransitionDirectionType.LEFT_TO_RIGHT);
style (default value: "none")
Defines the animation style.
BLINDS= BlindsBOX= BoxCOVER= CoverDISSOLVE= DissolveFADE= FadeFLY= FlyGLITTER= GlitterPUSH= PushSPLIT= SplitUNCOVER= UncoverWIPE= WipeNONE= No special effect
transitionAction.setStyle(OutlineTransitionStyleType.WIPE);
duration (default value: "1.0")
The duration of the animation in seconds. Values that are too high can cause problems in display applications.
transitionAction.setDuration(0.3f);
goTo3DView ActionType
When the element is selected, the document jumps to a specific view of a 3D annotation. The annotation itself is selected through an annotationSelection object.
GoTo3DViewActionType goTo3DView = new GoTo3DViewActionType();
firstPage.getActions().add(goTo3DView);
AnnotationSelectionType annotationSelection = new AnnotationSelectionType();
goTo3DView.setAnnotation(annotationSelection);
The following parameters and subelements can be selected for a goTo3DView action.
index
Selects the 3D annotation view by its index. Alternative to name and relative.
goTo3DView.setIndex(5);
name
Selects the 3D annotation view by its name. Alternative to index and relative.
goTo3DView.setName("name");
relative
Selects the 3D annotation view relative to the currently displayed view. Alternative to name and index.
FIRST= The first view of the 3D annotationLAST= The last view of the 3D annotationNEXT= The next view of the 3D annotationPREVIOUS= The previous view of the 3D annotationDEFAULT= The default view of the 3D annotation
goTo3DView.setRelative(RelativeThreeDViewOperationType.LAST);
goToThread ActionType
When the element is selected, the document jumps to a specific article defined within the document.
ThreadActionType thread = new ThreadActionType();
firstPage.getActions().add(thread);
The following parameters and subelements can be selected for a thread action.
threadIndex
Selects the article by its index in the document's article directory. Alternative to threadTitle.
thread.setThreadIndex(4);
threadTitle
Selects the article by its title. Alternative to threadIndex.
thread.setThreadTitle("threadTitle");
beadIndex
Selects the section of the article to jump to by its index.
thread.setBeadIndex(6);
page (default value: "1")
The page on which the article is located.
thread.setPage(3);
The remove Object
To remove elements from the document outline, add an OutlineType.Remove object to the Outline object.
OutlineType.Remove remove = new OutlineType.Remove();
outline.setRemove(remove);
The following elements can be added to the Remove object.
The itemReference Object
To remove elements, add any number of ItemReference objects to the Remove object. These objects select an outline node by its path. Paths consist of the slash-separated names of the entries, beginning with an initial slash. If a removed node contains child elements, those child elements are removed as well.
ItemReferenceType item = new ItemReferenceType();
remove.getItem().add(item);
The following parameters can be selected for an itemReference object.
path (default value: "")
Selects an outline element by its path.
item.setPath("/Chapter 1/Page 250/3D View");
The clear Object
To remove all elements from the document outline, add an OutlineType.Clear object to the Outline object.
ClearType clear = new ClearType();
outline.setClear(clear);
More Detailed Example
Finally, here is a somewhat more detailed example of the full webservice call for addressing the SOAP interface:
try (
// Set up a session with the webPDF server, here using SOAP.
SoapSession session = SessionFactory.createInstance(
WebServiceProtocol.SOAP,
new URL("https://localhost:8080/webPDF/")
);
// Provide the document to be processed and the target file.
SoapDocument soapDocument = new SoapDocument(
new File("Path of the source document").toURI(),
new File("Path of the target document")
)
) catch (ResultException ex)
Final Notes on Operation Outline
You can find more information on the outline parameter structure and error codes in our user manual.
Please also note that all parameters are pre-filled with certain default values. If a default value is given and it already matches the value you want, it is not strictly necessary to set that parameter.
More code examples for webservices such as Operation Outline that you can use with the wsclient library can be found here.