Class OdfDrawPage
Provides the OdfDrawPage API. 提供 OdfDrawPage API。
public class OdfDrawPage
- Inheritance
-
OdfDrawPage
- Inherited Members
Constructors
OdfDrawPage(OdfNode, DrawingDocument)
Represents an ODF drawing page. 表示 ODF 繪圖頁面(Drawing Page)的類別。
public OdfDrawPage(OdfNode node, DrawingDocument doc)
Parameters
nodeOdfNodeThe underlying OdfKit.DOM.OdfNode instance. / 底層的 OdfKit.DOM.OdfNode 執行個體。
docDrawingDocumentThe owning drawing document instance. / 所屬的繪圖文件執行個體。
Properties
Document
Gets the owning drawing document. 取得所屬的繪圖文件。
public DrawingDocument Document { get; }
Property Value
MasterPageName
Gets or sets the master page name used by the drawing page. 取得或設定繪圖頁面所使用的母片名稱。
public string? MasterPageName { get; set; }
Property Value
Name
Gets or sets the name of the drawing page. 取得或設定繪圖頁面的名稱。
public string Name { get; set; }
Property Value
Node
Gets the underlying ODF node. 取得底層的 ODF 節點。
public OdfNode Node { get; }
Property Value
- OdfNode
Pictures
Gets the list of pictures on the drawing page. 取得繪圖頁面上的圖片清單。
public IReadOnlyList<OdfPicture> Pictures { get; }
Property Value
Shapes
Gets the list of generic shapes on the drawing page. 取得繪圖頁面上的一般圖形清單。
public IReadOnlyList<OdfShape> Shapes { get; }
Property Value
TextBoxes
Gets the list of text boxes on the drawing page. 取得繪圖頁面上的文字方塊清單。
public IReadOnlyList<OdfTextBox> TextBoxes { get; }
Property Value
Methods
AddConnector(OdfLength, OdfLength, OdfLength, OdfLength)
Adds a connector on the drawing page. 在繪圖頁面上新增連接線。
public OdfShape AddConnector(OdfLength x1, OdfLength y1, OdfLength x2, OdfLength y2)
Parameters
x1OdfLengthThe start X-axis position. / 起點 X 軸座標位置。
y1OdfLengthThe start Y-axis position. / 起點 Y 軸座標位置。
x2OdfLengthThe end X-axis position. / 終點 X 軸座標位置。
y2OdfLengthThe end Y-axis position. / 終點 Y 軸座標位置。
Returns
- OdfShape
The newly added connector shape instance. / 新增的連接線圖形執行個體。
AddConnector(string, string)
Creates a connector linking a start shape and an end shape on the drawing page. 在繪圖頁面上建立起點與終點相連的連接線。
public OdfShape AddConnector(string startShapeId, string endShapeId)
Parameters
Returns
- OdfShape
The newly added connector shape instance. / 新增的連接線圖形執行個體。
AddConnector(string, string, OdfConnectorType)
Full overload of AddConnector that accepts startShapeId, endShapeId, and connectorType. AddConnector 完整多載:接受 startShapeId、endShapeId 與 connectorType。
public OdfShape AddConnector(string startShapeId, string endShapeId, OdfConnectorType connectorType)
Parameters
startShapeIdstringendShapeIdstringconnectorTypeOdfConnectorType
Returns
AddCustomShape(string, OdfLength, OdfLength, OdfLength, OdfLength)
Adds a custom shape on the drawing page. 在繪圖頁面上新增自定義幾何圖形。
public OdfShape AddCustomShape(string shapeType, OdfLength x, OdfLength y, OdfLength width, OdfLength height)
Parameters
shapeTypestringThe geometry type of the custom shape. / 自定義幾何圖形的幾何類型。
xOdfLengthThe X-axis position. / X 軸座標位置。
yOdfLengthThe Y-axis position. / Y 軸座標位置。
widthOdfLengthThe width. / 寬度。
heightOdfLengthThe height. / 高度。
Returns
- OdfShape
The newly added custom shape instance. / 新增的自定義幾何圖形執行個體。
AddGroup()
Short overload of AddGroup that uses default values for all optional parameters and forwards to the full overload. 便利多載:AddGroup 的所有可選參數使用預設值並轉呼叫最長多載。
public OdfDrawGroup AddGroup()
Returns
AddGroup(string?)
Adds a group on the drawing page. 在繪圖頁面上新增群組。
public OdfDrawGroup AddGroup(string? name)
Parameters
namestringThe optional group name. / 選用的群組名稱。
Returns
- OdfDrawGroup
The newly added drawing group instance. / 新增的繪圖群組執行個體。
AddLine(OdfLength, OdfLength, OdfLength, OdfLength)
Adds a line segment on the drawing page. 在繪圖頁面上新增線段。
public OdfShape AddLine(OdfLength x1, OdfLength y1, OdfLength x2, OdfLength y2)
Parameters
x1OdfLengthThe start X-axis position. / 起點 X 軸座標位置。
y1OdfLengthThe start Y-axis position. / 起點 Y 軸座標位置。
x2OdfLengthThe end X-axis position. / 終點 X 軸座標位置。
y2OdfLengthThe end Y-axis position. / 終點 Y 軸座標位置。
Returns
- OdfShape
The newly added line shape instance. / 新增的線段圖形執行個體。
AddPath(string, OdfLength, OdfLength, OdfLength, OdfLength)
Adds a path shape on the drawing page. 在繪圖頁面上新增路徑圖形。
public OdfShape AddPath(string svgPathData, OdfLength x, OdfLength y, OdfLength width, OdfLength height)
Parameters
svgPathDatastringThe SVG path data description string. / SVG path data 路徑描述字串。
xOdfLengthThe X-axis position. / X 軸座標位置。
yOdfLengthThe Y-axis position. / Y 軸座標位置。
widthOdfLengthThe width. / 寬度。
heightOdfLengthThe height. / 高度。
Returns
- OdfShape
The newly added path shape instance. / 新增的路徑圖形執行個體。
AddPicture(byte[], OdfLength, OdfLength, OdfLength, OdfLength)
Adds a picture on the drawing page. 在繪圖頁面上新增圖片。
public OdfPicture AddPicture(byte[] imageBytes, OdfLength x, OdfLength y, OdfLength w, OdfLength h)
Parameters
imageBytesbyte[]The image byte array. / 圖片的位元組陣列。
xOdfLengthThe X-axis position. / X 軸座標位置。
yOdfLengthThe Y-axis position. / Y 軸座標位置。
wOdfLengthThe width. / 寬度。
hOdfLengthThe height. / 高度。
Returns
- OdfPicture
The newly added picture shape instance. / 新增的圖片圖形執行個體。
AddPolygon(IEnumerable<(OdfLength X, OdfLength Y)>)
Adds a polygon shape on the drawing page. 在繪圖頁面上新增多邊形圖形。
public OdfShape AddPolygon(IEnumerable<(OdfLength X, OdfLength Y)> points)
Parameters
pointsIEnumerable<(OdfLength X, OdfLength Y)>The length-based coordinate collection of polygon vertices. / 多邊形頂點的長度座標集合。
Returns
- OdfShape
The newly added polygon shape instance. / 新增的多邊形圖形執行個體。
AddPolyline(IEnumerable<PointF>, OdfLength, OdfLength, OdfLength, OdfLength)
Adds a polyline shape on the drawing page. 在繪圖頁面上新增折線圖形。
public OdfShape AddPolyline(IEnumerable<PointF> points, OdfLength x, OdfLength y, OdfLength w, OdfLength h)
Parameters
pointsIEnumerable<PointF>The collection of point coordinates. / 點座標集合。
xOdfLengthThe X-axis position. / X 軸座標位置。
yOdfLengthThe Y-axis position. / Y 軸座標位置。
wOdfLengthThe width. / 寬度。
hOdfLengthThe height. / 高度。
Returns
- OdfShape
The newly added polyline shape instance. / 新增的折線圖形執行個體。
AddShape(OdfShapeType, OdfLength, OdfLength, OdfLength, OdfLength)
Adds a shape on the drawing page. 在繪圖頁面上新增圖形。
public OdfShape AddShape(OdfShapeType shapeType, OdfLength x, OdfLength y, OdfLength w, OdfLength h)
Parameters
shapeTypeOdfShapeTypeThe shape type. / 圖形類型。
xOdfLengthThe X-axis position. / X 軸座標位置。
yOdfLengthThe Y-axis position. / Y 軸座標位置。
wOdfLengthThe width. / 寬度。
hOdfLengthThe height. / 高度。
Returns
- OdfShape
The newly added shape instance. / 新增的圖形執行個體。
AddTextBox(OdfLength, OdfLength, OdfLength, OdfLength, string)
Adds a text box on the drawing page. 在繪圖頁面上新增文字方塊。
public OdfTextBox AddTextBox(OdfLength x, OdfLength y, OdfLength w, OdfLength h, string text)
Parameters
xOdfLengthThe X-axis position. / X 軸座標位置。
yOdfLengthThe Y-axis position. / Y 軸座標位置。
wOdfLengthThe width. / 寬度。
hOdfLengthThe height. / 高度。
textstringThe text content. / 文字內容。
Returns
- OdfTextBox
The newly added text box instance. / 新增的文字方塊執行個體。
AddTextBox(OdfLength, OdfLength, OdfLength, OdfLength, string, OdfTextFontFallbackOptions)
Adds a text box with the specified font fallback options. 使用指定的字型遞補選項新增文字方塊。
public OdfTextBox AddTextBox(OdfLength x, OdfLength y, OdfLength w, OdfLength h, string text, OdfTextFontFallbackOptions options)
Parameters
xOdfLengthThe X-axis position. / X 軸座標位置。
yOdfLengthThe Y-axis position. / Y 軸座標位置。
wOdfLengthThe width. / 寬度。
hOdfLengthThe height. / 高度。
textstringThe text content. / 文字內容。
optionsOdfTextFontFallbackOptionsThe font fallback options. / 字型遞補選項。
Returns
- OdfTextBox
The newly added text box instance. / 新增的文字方塊執行個體。
GetConnectors()
Gets a summary list of all connectors on this drawing page. 取得此繪圖頁面上所有連接線的摘要清單。
public IReadOnlyList<OdfConnectorInfo> GetConnectors()
Returns
GetCustomShapes()
Gets a summary list of all custom shapes on this drawing page. 取得此繪圖頁面上所有自定義幾何圖形的摘要清單。
public IReadOnlyList<OdfCustomShapeInfo> GetCustomShapes()
Returns
GetGroups()
Gets a summary list of all group shapes on this drawing page. 取得此繪圖頁面上所有群組圖形的摘要清單。
public IReadOnlyList<OdfGroupInfo> GetGroups()
Returns
GetLayers()
Gets a summary list of all layers on this drawing page. 取得此繪圖頁面上所有圖層的摘要清單。
public IReadOnlyList<OdfLayerInfo> GetLayers()
Returns
GetPaths()
Gets a summary list of all path shapes on this drawing page. 取得此繪圖頁面上所有路徑圖形的摘要清單。
public IReadOnlyList<OdfPathInfo> GetPaths()
Returns
GetPictures()
Gets a summary list of all pictures on this drawing page. 取得此繪圖頁面上所有圖片的摘要清單。
public IReadOnlyList<OdfDrawPictureInfo> GetPictures()
Returns
GetPolygons()
Gets a summary list of all polygon shapes on this drawing page. 取得此繪圖頁面上所有多邊形圖形的摘要清單。
public IReadOnlyList<OdfPolygonInfo> GetPolygons()
Returns
GetShapeLayerAssignments()
Gets a summary list of all shape-to-layer assignments on this drawing page. 取得此繪圖頁面上所有圖形圖層指派的摘要清單。
public IReadOnlyList<OdfDrawShapeLayerInfo> GetShapeLayerAssignments()
Returns
GetTextBoxes()
Gets a summary list of all text boxes on this drawing page. 取得此繪圖頁面上所有文字方塊的摘要清單。
public IReadOnlyList<OdfDrawTextBoxInfo> GetTextBoxes()
Returns
GroupShapes(IEnumerable<string>)
Short overload of GroupShapes that accepts shapeIds; remaining optional parameters use defaults and forward to the full overload. 便利多載:提供 shapeIds;其餘可選參數使用預設值並轉呼叫最長 GroupShapes 多載。
public OdfDrawGroup GroupShapes(IEnumerable<string> shapeIds)
Parameters
shapeIdsIEnumerable<string>
Returns
GroupShapes(IEnumerable<string>, string?)
Merges the specified shapes into a new group. 將指定圖形合併為新群組。
public OdfDrawGroup GroupShapes(IEnumerable<string> shapeIds, string? name)
Parameters
shapeIdsIEnumerable<string>The collection of shape identifiers to group. / 要群組的圖形識別碼集合。
namestringThe optional group name. / 選用的群組名稱。
Returns
- OdfDrawGroup
The newly created group instance. / 新建立的群組執行個體。