Table of Contents

Class OdfDrawPage

Namespace
OdfKit.Drawing
Assembly
OdfKit.dll

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

node OdfNode

The underlying OdfKit.DOM.OdfNode instance. / 底層的 OdfKit.DOM.OdfNode 執行個體。

doc DrawingDocument

The owning drawing document instance. / 所屬的繪圖文件執行個體。

Properties

Document

Gets the owning drawing document. 取得所屬的繪圖文件。

public DrawingDocument Document { get; }

Property Value

DrawingDocument

MasterPageName

Gets or sets the master page name used by the drawing page. 取得或設定繪圖頁面所使用的母片名稱。

public string? MasterPageName { get; set; }

Property Value

string

Name

Gets or sets the name of the drawing page. 取得或設定繪圖頁面的名稱。

public string Name { get; set; }

Property Value

string

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

IReadOnlyList<OdfPicture>

Shapes

Gets the list of generic shapes on the drawing page. 取得繪圖頁面上的一般圖形清單。

public IReadOnlyList<OdfShape> Shapes { get; }

Property Value

IReadOnlyList<OdfShape>

TextBoxes

Gets the list of text boxes on the drawing page. 取得繪圖頁面上的文字方塊清單。

public IReadOnlyList<OdfTextBox> TextBoxes { get; }

Property Value

IReadOnlyList<OdfTextBox>

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

x1 OdfLength

The start X-axis position. / 起點 X 軸座標位置。

y1 OdfLength

The start Y-axis position. / 起點 Y 軸座標位置。

x2 OdfLength

The end X-axis position. / 終點 X 軸座標位置。

y2 OdfLength

The 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

startShapeId string
endShapeId string

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

startShapeId string
endShapeId string
connectorType OdfConnectorType

Returns

OdfShape

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

shapeType string

The geometry type of the custom shape. / 自定義幾何圖形的幾何類型。

x OdfLength

The X-axis position. / X 軸座標位置。

y OdfLength

The Y-axis position. / Y 軸座標位置。

width OdfLength

The width. / 寬度。

height OdfLength

The 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

OdfDrawGroup

AddGroup(string?)

Adds a group on the drawing page. 在繪圖頁面上新增群組。

public OdfDrawGroup AddGroup(string? name)

Parameters

name string

The 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

x1 OdfLength

The start X-axis position. / 起點 X 軸座標位置。

y1 OdfLength

The start Y-axis position. / 起點 Y 軸座標位置。

x2 OdfLength

The end X-axis position. / 終點 X 軸座標位置。

y2 OdfLength

The 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

svgPathData string

The SVG path data description string. / SVG path data 路徑描述字串。

x OdfLength

The X-axis position. / X 軸座標位置。

y OdfLength

The Y-axis position. / Y 軸座標位置。

width OdfLength

The width. / 寬度。

height OdfLength

The 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

imageBytes byte[]

The image byte array. / 圖片的位元組陣列。

x OdfLength

The X-axis position. / X 軸座標位置。

y OdfLength

The Y-axis position. / Y 軸座標位置。

w OdfLength

The width. / 寬度。

h OdfLength

The 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

points IEnumerable<(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

points IEnumerable<PointF>

The collection of point coordinates. / 點座標集合。

x OdfLength

The X-axis position. / X 軸座標位置。

y OdfLength

The Y-axis position. / Y 軸座標位置。

w OdfLength

The width. / 寬度。

h OdfLength

The 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

shapeType OdfShapeType

The shape type. / 圖形類型。

x OdfLength

The X-axis position. / X 軸座標位置。

y OdfLength

The Y-axis position. / Y 軸座標位置。

w OdfLength

The width. / 寬度。

h OdfLength

The 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

x OdfLength

The X-axis position. / X 軸座標位置。

y OdfLength

The Y-axis position. / Y 軸座標位置。

w OdfLength

The width. / 寬度。

h OdfLength

The height. / 高度。

text string

The 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

x OdfLength

The X-axis position. / X 軸座標位置。

y OdfLength

The Y-axis position. / Y 軸座標位置。

w OdfLength

The width. / 寬度。

h OdfLength

The height. / 高度。

text string

The text content. / 文字內容。

options OdfTextFontFallbackOptions

The 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

IReadOnlyList<OdfConnectorInfo>

GetCustomShapes()

Gets a summary list of all custom shapes on this drawing page. 取得此繪圖頁面上所有自定義幾何圖形的摘要清單。

public IReadOnlyList<OdfCustomShapeInfo> GetCustomShapes()

Returns

IReadOnlyList<OdfCustomShapeInfo>

GetGroups()

Gets a summary list of all group shapes on this drawing page. 取得此繪圖頁面上所有群組圖形的摘要清單。

public IReadOnlyList<OdfGroupInfo> GetGroups()

Returns

IReadOnlyList<OdfGroupInfo>

GetLayers()

Gets a summary list of all layers on this drawing page. 取得此繪圖頁面上所有圖層的摘要清單。

public IReadOnlyList<OdfLayerInfo> GetLayers()

Returns

IReadOnlyList<OdfLayerInfo>

GetPaths()

Gets a summary list of all path shapes on this drawing page. 取得此繪圖頁面上所有路徑圖形的摘要清單。

public IReadOnlyList<OdfPathInfo> GetPaths()

Returns

IReadOnlyList<OdfPathInfo>

GetPictures()

Gets a summary list of all pictures on this drawing page. 取得此繪圖頁面上所有圖片的摘要清單。

public IReadOnlyList<OdfDrawPictureInfo> GetPictures()

Returns

IReadOnlyList<OdfDrawPictureInfo>

GetPolygons()

Gets a summary list of all polygon shapes on this drawing page. 取得此繪圖頁面上所有多邊形圖形的摘要清單。

public IReadOnlyList<OdfPolygonInfo> GetPolygons()

Returns

IReadOnlyList<OdfPolygonInfo>

GetShapeLayerAssignments()

Gets a summary list of all shape-to-layer assignments on this drawing page. 取得此繪圖頁面上所有圖形圖層指派的摘要清單。

public IReadOnlyList<OdfDrawShapeLayerInfo> GetShapeLayerAssignments()

Returns

IReadOnlyList<OdfDrawShapeLayerInfo>

GetTextBoxes()

Gets a summary list of all text boxes on this drawing page. 取得此繪圖頁面上所有文字方塊的摘要清單。

public IReadOnlyList<OdfDrawTextBoxInfo> GetTextBoxes()

Returns

IReadOnlyList<OdfDrawTextBoxInfo>

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

shapeIds IEnumerable<string>

Returns

OdfDrawGroup

GroupShapes(IEnumerable<string>, string?)

Merges the specified shapes into a new group. 將指定圖形合併為新群組。

public OdfDrawGroup GroupShapes(IEnumerable<string> shapeIds, string? name)

Parameters

shapeIds IEnumerable<string>

The collection of shape identifiers to group. / 要群組的圖形識別碼集合。

name string

The optional group name. / 選用的群組名稱。

Returns

OdfDrawGroup

The newly created group instance. / 新建立的群組執行個體。