InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
SnpManipulatePathandGraphics Class Reference

Public Member Functions

 SnpManipulatePathandGraphics ()
 
virtual ~SnpManipulatePathandGraphics ()
 
ErrorCode MakeCompoundPath (UIDList itemList)
 
ErrorCode ConvertShape (UIDList itemList)
 
ErrorCode PerformContentFitting (UIDList itemList)
 
ErrorCode SetClippingPath ()
 
ErrorCode SetTextWrapContourOptions (UIDList itemList)
 

Detailed Description

This code snippet provide samples for manipulating path and graphic page item settings, specifically, the following area are covered:

  • How to perform path operations,
  • How to fit graphic items with frame,
  • How to set up clipping path,
  • How to set up text wrap options,

Note: (1) Selection suites takes care of selection of a frame or a graphic item, so when setting clipping path, we do not need to find graphic item of the frame. (2) Since we don't provide method to get number of alpah channel and photoshop path directly, so if alpha or photoshop path index is invalid, you may see assert, but it is ignorable. (3) This snippet does not include set text wrap mode. Please see SnpManipulateTextFrame for sample. Since text wrap contour options only available when there is a graphic selected and the text wrap mode is "Wrap around object shape", you will have to manually set it on text wrap palette to make this snippet functions as expected.

Constructor & Destructor Documentation

SnpManipulatePathandGraphics::SnpManipulatePathandGraphics ()
inline

Constructor.

virtual SnpManipulatePathandGraphics::~SnpManipulatePathandGraphics ()
inlinevirtual

Destructor

Member Function Documentation

ErrorCode SnpManipulatePathandGraphics::ConvertShape (UIDList itemList)

Perform path operations

Parameters
itemListthe selected page items.
Returns
kSuccess on success, other ErrorCode otherwise.

Convert shape. Other path operations such as path finder (compound shape) is similar, but use IPathOperationSuite.

ErrorCode SnpManipulatePathandGraphics::MakeCompoundPath (UIDList itemList)

Perform path operations

Parameters
itemListthe selected page items.
Returns
kSuccess on success, other ErrorCode otherwise.

Making compound path

ErrorCode SnpManipulatePathandGraphics::PerformContentFitting (UIDList itemList)

Fit graphic content with frame

Parameters
itemListthe selected page items.
Returns
kSuccess on success, other ErrorCode otherwise.

Content fitting. The sample only lists for graphic frame content fitting, you may also fit frame to content for text frame too.

ErrorCode SnpManipulatePathandGraphics::SetClippingPath ()

Set up clipping path of a graphic item

Returns
kSuccess on success, other ErrorCode otherwise.

Setting up clipping path use clipping suite.

ErrorCode SnpManipulatePathandGraphics::SetTextWrapContourOptions (UIDList itemList)

Set up text wrap contour options

Parameters
itemListthe selected page items.
Returns
kSuccess on success, other ErrorCode otherwise.

Setting up text wrap contour options using text wrap facade. See also manipluate text frame snippet for setting text wrap mode.