Class OdfSlide
- Namespace
- OdfKit.Presentation
- Assembly
- OdfKit.dll
Provides the OdfSlide API. 提供 OdfSlide API。
public class OdfSlide
- Inheritance
-
OdfSlide
- Inherited Members
Constructors
OdfSlide(OdfNode, PresentationDocument)
Represents a presentation slide. 表示簡報投影片(Slide)的類別。
public OdfSlide(OdfNode node, PresentationDocument doc)
Parameters
nodeOdfNodeThe underlying OdfKit.DOM.OdfNode instance. / 底層的 OdfKit.DOM.OdfNode 執行個體。
docPresentationDocumentThe owning presentation document instance. / 所屬的簡報文件執行個體。
Properties
AnimationRoot
Gets the animation root node. 取得動畫根節點。
public OdfAnimationNode AnimationRoot { get; }
Property Value
BackgroundColor
Gets or sets the slide background color, such as #FFFFFF.
取得或設定投影片背景色(例如 #FFFFFF)。
public string? BackgroundColor { get; set; }
Property Value
Document
Gets the owning presentation document. 取得所屬的簡報文件。
public PresentationDocument Document { get; }
Property Value
MasterPageName
Gets or sets the master page name used by the slide. 取得或設定投影片使用的母片名稱。
public string MasterPageName { get; set; }
Property Value
Name
Gets or sets the slide name. 取得或設定投影片名稱。
public string Name { get; set; }
Property Value
Pictures
Gets the pictures on the slide. 取得投影片上的圖片清單。
public IReadOnlyList<OdfPicture> Pictures { get; }
Property Value
Placeholders
Gets the read-only list of all placeholders in the slide. 取得投影片中所有預留位置的唯讀清單。
public IReadOnlyList<OdfPlaceholder> Placeholders { get; }
Property Value
PresentationPageLayoutName
Gets or sets the page layout name used by the slide. 取得或設定投影片使用的版面配置名稱。
public string? PresentationPageLayoutName { get; set; }
Property Value
Shapes
Gets the general shapes on the slide. 取得投影片上的一般圖形清單。
public IReadOnlyList<OdfShape> Shapes { get; }
Property Value
SpeakerNoteParagraphs
Gets the paragraph text of the slide speaker notes. 取得投影片備忘錄的段落文字。
public IReadOnlyList<string> SpeakerNoteParagraphs { get; }
Property Value
SpeakerNotes
Gets or sets the slide speaker notes text. 取得或設定投影片備忘錄文字。
public string SpeakerNotes { get; set; }
Property Value
SpeakerNotesPage
Gets the slide notes page. 取得投影片的備忘錄頁面(Notes Page)。
public OdfNotesPage SpeakerNotesPage { get; }
Property Value
TextBoxes
Gets the text boxes on the slide. 取得投影片上的文字方塊清單。
public IReadOnlyList<OdfTextBox> TextBoxes { get; }
Property Value
UseDateTimeName
Gets or sets the style name used by the slide date and time field. 取得或設定投影片日期與時間使用的樣式名稱。
public string? UseDateTimeName { get; set; }
Property Value
UseFooterName
Gets or sets the style name used by the slide footer. 取得或設定投影片頁尾使用的樣式名稱。
public string? UseFooterName { get; set; }
Property Value
UseHeaderName
Gets or sets the style name used by the slide header. 取得或設定投影片頁首使用的樣式名稱。
public string? UseHeaderName { get; set; }
Property Value
Methods
AddAudio(string, OdfLength, OdfLength, OdfLength, OdfLength)
Short overload of AddAudio that accepts packagePath, x, y, width, and height; remaining optional parameters use defaults and forward to the full overload. 便利多載:提供 packagePath、x、y、width 與 height;其餘可選參數使用預設值並轉呼叫最長 AddAudio 多載。
public OdfMediaObject AddAudio(string packagePath, OdfLength x, OdfLength y, OdfLength width, OdfLength height)
Parameters
Returns
AddAudio(string, OdfLength, OdfLength, OdfLength, OdfLength, string)
Adds an audio object to the slide. 在投影片上新增音訊物件。
public OdfMediaObject AddAudio(string packagePath, OdfLength x, OdfLength y, OdfLength width, OdfLength height, string mimeType)
Parameters
packagePathstringThe audio path inside the package. / 音訊在封裝包內的路徑。
xOdfLengthThe X-axis coordinate position. / X 軸座標位置。
yOdfLengthThe Y-axis coordinate position. / Y 軸座標位置。
widthOdfLengthThe width. / 寬度。
heightOdfLengthThe height. / 高度。
mimeTypestringThe audio MIME type. / 音訊 MIME 類型。
Returns
- OdfMediaObject
The newly created media object. / 新建立的媒體物件。
AddEmbeddedObject(string, OdfLength, OdfLength, OdfLength, OdfLength)
Adds an embedded object, such as another document or subcomponent, to the slide. 在投影片上新增內嵌物件(如其他文件或子組件)。
public OdfShape AddEmbeddedObject(string subPath, OdfLength x, OdfLength y, OdfLength w, OdfLength h)
Parameters
subPathstringThe path of the embedded object inside the package. / 內嵌物件於套件內的路徑。
xOdfLengthThe X-axis coordinate position. / X 軸座標位置。
yOdfLengthThe Y-axis coordinate position. / Y 軸座標位置。
wOdfLengthThe width. / 寬度。
hOdfLengthThe height. / 高度。
Returns
- OdfShape
The added embedded object shape instance. / 新增內嵌物件圖形執行個體。
AddEmphasisEffect(string, OdfAnimationEffect)
Short overload of AddEmphasisEffect that accepts shapeId and effect; remaining optional parameters use defaults and forward to the full overload. 便利多載:提供 shapeId 與 effect;其餘可選參數使用預設值並轉呼叫最長 AddEmphasisEffect 多載。
public OdfAnimation AddEmphasisEffect(string shapeId, OdfAnimationEffect effect)
Parameters
shapeIdstringeffectOdfAnimationEffect
Returns
AddEmphasisEffect(string, OdfAnimationEffect, TimeSpan)
Short overload of AddEmphasisEffect that accepts shapeId, effect, and duration; remaining optional parameters use defaults and forward to the full overload. 便利多載:提供 shapeId、effect 與 duration;其餘可選參數使用預設值並轉呼叫最長 AddEmphasisEffect 多載。
public OdfAnimation AddEmphasisEffect(string shapeId, OdfAnimationEffect effect, TimeSpan duration)
Parameters
shapeIdstringeffectOdfAnimationEffectdurationTimeSpan
Returns
AddEmphasisEffect(string, OdfAnimationEffect, TimeSpan, OdfAnimationTrigger)
Short overload of AddEmphasisEffect that accepts shapeId, effect, duration, and trigger; remaining optional parameters use defaults and forward to the full overload. 便利多載:提供 shapeId、effect、duration 與 trigger;其餘可選參數使用預設值並轉呼叫最長 AddEmphasisEffect 多載。
public OdfAnimation AddEmphasisEffect(string shapeId, OdfAnimationEffect effect, TimeSpan duration, OdfAnimationTrigger trigger)
Parameters
shapeIdstringeffectOdfAnimationEffectdurationTimeSpantriggerOdfAnimationTrigger
Returns
AddEmphasisEffect(string, OdfAnimationEffect, TimeSpan, OdfAnimationTrigger, TimeSpan)
Adds an emphasis animation to the specified shape. 為指定的圖形新增物件強調動畫。
public OdfAnimation AddEmphasisEffect(string shapeId, OdfAnimationEffect effect, TimeSpan duration, OdfAnimationTrigger trigger, TimeSpan delay)
Parameters
shapeIdstringThe target shape identifier. / 目標圖形識別碼。
effectOdfAnimationEffectThe animation effect type. / 動畫效果類型。
durationTimeSpanThe animation duration; defaults to 0.5 seconds. / 動畫持續時間;預設為 0.5 秒。
triggerOdfAnimationTriggerThe animation trigger mode. / 動畫觸發方式。
delayTimeSpanThe animation startup delay. / 動畫延遲啟動時間。
Returns
- OdfAnimation
The added animation object instance. / 新增的動畫物件執行個體。
AddEntranceEffect(string, OdfAnimationEffect, OdfAnimationTrigger)
Short overload of AddEntranceEffect that accepts shapeId, effect, and trigger; remaining optional parameters use defaults and forward to the full overload. 便利多載:提供 shapeId、effect 與 trigger;其餘可選參數使用預設值並轉呼叫最長 AddEntranceEffect 多載。
public OdfAnimation AddEntranceEffect(string shapeId, OdfAnimationEffect effect, OdfAnimationTrigger trigger)
Parameters
shapeIdstringeffectOdfAnimationEffecttriggerOdfAnimationTrigger
Returns
AddEntranceEffect(string, OdfAnimationEffect, OdfAnimationTrigger, TimeSpan)
Short overload of AddEntranceEffect that accepts shapeId, effect, trigger, and delay; remaining optional parameters use defaults and forward to the full overload. 便利多載:提供 shapeId、effect、trigger 與 delay;其餘可選參數使用預設值並轉呼叫最長 AddEntranceEffect 多載。
public OdfAnimation AddEntranceEffect(string shapeId, OdfAnimationEffect effect, OdfAnimationTrigger trigger, TimeSpan delay)
Parameters
shapeIdstringeffectOdfAnimationEffecttriggerOdfAnimationTriggerdelayTimeSpan
Returns
AddEntranceEffect(string, OdfAnimationEffect, OdfAnimationTrigger, TimeSpan, TimeSpan)
Adds an entrance animation to the specified shape. 為指定的圖形新增物件進場動畫。
public OdfAnimation AddEntranceEffect(string shapeId, OdfAnimationEffect effect, OdfAnimationTrigger trigger, TimeSpan delay, TimeSpan duration)
Parameters
shapeIdstringThe target shape identifier. / 目標圖形識別碼。
effectOdfAnimationEffectThe animation effect type. / 動畫效果類型。
triggerOdfAnimationTriggerThe animation trigger mode. / 動畫觸發方式。
delayTimeSpanThe animation startup delay. / 動畫延遲啟動時間。
durationTimeSpanThe animation duration; defaults to 0.5 seconds. / 動畫持續時間;預設為 0.5 秒。
Returns
- OdfAnimation
The added animation object instance. / 新增的動畫物件執行個體。
AddExitEffect(string, OdfAnimationEffect, OdfAnimationTrigger)
Short overload of AddExitEffect that accepts shapeId, effect, and trigger; remaining optional parameters use defaults and forward to the full overload. 便利多載:提供 shapeId、effect 與 trigger;其餘可選參數使用預設值並轉呼叫最長 AddExitEffect 多載。
public OdfAnimation AddExitEffect(string shapeId, OdfAnimationEffect effect, OdfAnimationTrigger trigger)
Parameters
shapeIdstringeffectOdfAnimationEffecttriggerOdfAnimationTrigger
Returns
AddExitEffect(string, OdfAnimationEffect, OdfAnimationTrigger, TimeSpan)
Short overload of AddExitEffect that accepts shapeId, effect, trigger, and delay; remaining optional parameters use defaults and forward to the full overload. 便利多載:提供 shapeId、effect、trigger 與 delay;其餘可選參數使用預設值並轉呼叫最長 AddExitEffect 多載。
public OdfAnimation AddExitEffect(string shapeId, OdfAnimationEffect effect, OdfAnimationTrigger trigger, TimeSpan delay)
Parameters
shapeIdstringeffectOdfAnimationEffecttriggerOdfAnimationTriggerdelayTimeSpan
Returns
AddExitEffect(string, OdfAnimationEffect, OdfAnimationTrigger, TimeSpan, TimeSpan)
Adds an exit animation to the specified shape. 為指定的圖形新增物件退場動畫。
public OdfAnimation AddExitEffect(string shapeId, OdfAnimationEffect effect, OdfAnimationTrigger trigger, TimeSpan delay, TimeSpan duration)
Parameters
shapeIdstringThe target shape identifier. / 目標圖形識別碼。
effectOdfAnimationEffectThe animation effect type. / 動畫效果類型。
triggerOdfAnimationTriggerThe animation trigger mode. / 動畫觸發方式。
delayTimeSpanThe animation startup delay. / 動畫延遲啟動時間。
durationTimeSpanThe animation duration; defaults to 0.5 seconds. / 動畫持續時間;預設為 0.5 秒。
Returns
- OdfAnimation
The added animation object instance. / 新增的動畫物件執行個體。
AddLine(OdfLength, OdfLength, OdfLength, OdfLength)
Adds a line shape to the slide. 在投影片上新增直線圖形。
public OdfShape AddLine(OdfLength x1, OdfLength y1, OdfLength x2, OdfLength y2)
Parameters
x1OdfLengthThe starting X-axis coordinate position. / 起點 X 軸座標位置。
y1OdfLengthThe starting Y-axis coordinate position. / 起點 Y 軸座標位置。
x2OdfLengthThe ending X-axis coordinate position. / 終點 X 軸座標位置。
y2OdfLengthThe ending Y-axis coordinate position. / 終點 Y 軸座標位置。
Returns
- OdfShape
The added line shape instance. / 新增的直線圖形執行個體。
AddPicture(byte[], OdfLength, OdfLength, OdfLength, OdfLength)
Short overload of AddPicture that accepts imageBytes, x, y, w, and h; remaining optional parameters use defaults and forward to the full overload. 便利多載:提供 imageBytes、x、y、w 與 h;其餘可選參數使用預設值並轉呼叫最長 AddPicture 多載。
public OdfPicture AddPicture(byte[] imageBytes, OdfLength x, OdfLength y, OdfLength w, OdfLength h)
Parameters
Returns
AddPicture(byte[], OdfLength, OdfLength, OdfLength, OdfLength, string?)
Adds an image to the slide. 在投影片上新增圖片。
public OdfPicture AddPicture(byte[] imageBytes, OdfLength x, OdfLength y, OdfLength w, OdfLength h, string? altText)
Parameters
imageBytesbyte[]The image byte array. / 圖片的位元組陣列。
xOdfLengthThe X-axis coordinate position. / X 軸座標位置。
yOdfLengthThe Y-axis coordinate position. / Y 軸座標位置。
wOdfLengthThe width. / 寬度。
hOdfLengthThe height. / 高度。
altTextstringThe optional image alternative text. / 選用的圖片替代文字。
Returns
- OdfPicture
The added picture shape instance. / 新增的圖片圖形執行個體。
AddPlaceholder(OdfPlaceholderType, OdfLength, OdfLength, OdfLength, OdfLength)
Adds a placeholder to the slide. 在投影片上新增一個預留位置(Placeholder)。
public OdfPlaceholder AddPlaceholder(OdfPlaceholderType type, OdfLength x, OdfLength y, OdfLength w, OdfLength h)
Parameters
typeOdfPlaceholderTypeThe placeholder type. / 預留位置類型。
xOdfLengthThe X-axis coordinate position. / X 軸座標位置。
yOdfLengthThe Y-axis coordinate position. / Y 軸座標位置。
wOdfLengthThe width. / 寬度。
hOdfLengthThe height. / 高度。
Returns
- OdfPlaceholder
The added placeholder shape instance. / 新增的預留位置圖形執行個體。
AddPolyline(IEnumerable<PointF>, OdfLength, OdfLength, OdfLength, OdfLength)
Adds a polyline shape to the slide. 在投影片上新增折線圖形。
public OdfShape AddPolyline(IEnumerable<PointF> points, OdfLength x, OdfLength y, OdfLength w, OdfLength h)
Parameters
pointsIEnumerable<PointF>The point coordinate collection. / 點座標集合。
xOdfLengthThe X-axis coordinate position. / X 軸座標位置。
yOdfLengthThe Y-axis coordinate position. / Y 軸座標位置。
wOdfLengthThe width. / 寬度。
hOdfLengthThe height. / 高度。
Returns
- OdfShape
The added polyline shape instance. / 新增的折線圖形執行個體。
AddShape(OdfShapeType, OdfLength, OdfLength, OdfLength, OdfLength)
Adds a basic shape to the slide. 在投影片上新增基本圖形。
public OdfShape AddShape(OdfShapeType shapeType, OdfLength x, OdfLength y, OdfLength w, OdfLength h)
Parameters
shapeTypeOdfShapeTypeThe shape type. / 圖形類型。
xOdfLengthThe X-axis coordinate position. / X 軸座標位置。
yOdfLengthThe Y-axis coordinate position. / Y 軸座標位置。
wOdfLengthThe width. / 寬度。
hOdfLengthThe height. / 高度。
Returns
- OdfShape
The added shape instance. / 新增的圖形執行個體。
AddTextBox(OdfLength, OdfLength, OdfLength, OdfLength, IEnumerable<string>)
Adds a multi-paragraph text box to the slide. 在投影片上新增多段落文字方塊。
public OdfTextBox AddTextBox(OdfLength x, OdfLength y, OdfLength w, OdfLength h, IEnumerable<string> paragraphs)
Parameters
xOdfLengthThe X-axis coordinate position. / X 軸座標位置。
yOdfLengthThe Y-axis coordinate position. / Y 軸座標位置。
wOdfLengthThe width. / 寬度。
hOdfLengthThe height. / 高度。
paragraphsIEnumerable<string>The paragraph text collection. / 段落文字集合。
Returns
- OdfTextBox
The added text box shape instance. / 新增的文字方塊圖形執行個體。
AddTextBox(OdfLength, OdfLength, OdfLength, OdfLength, string)
Adds a text box to the slide. 在投影片上新增文字方塊。
public OdfTextBox AddTextBox(OdfLength x, OdfLength y, OdfLength w, OdfLength h, string text)
Parameters
xOdfLengthThe X-axis coordinate position. / X 軸座標位置。
yOdfLengthThe Y-axis coordinate position. / Y 軸座標位置。
wOdfLengthThe width. / 寬度。
hOdfLengthThe height. / 高度。
textstringThe text content. / 文字內容。
Returns
- OdfTextBox
The added text box shape 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 coordinate position. / X 軸座標位置。
yOdfLengthThe Y-axis coordinate position. / Y 軸座標位置。
wOdfLengthThe width. / 寬度。
hOdfLengthThe height. / 高度。
textstringThe text content. / 文字內容。
optionsOdfTextFontFallbackOptionsThe font fallback options. / 字型遞補選項。
Returns
- OdfTextBox
The added text box shape instance. / 新增的文字方塊圖形執行個體。
AddVideo(string, OdfLength, OdfLength, OdfLength, OdfLength)
Short overload of AddVideo that accepts packagePath, x, y, width, and height; remaining optional parameters use defaults and forward to the full overload. 便利多載:提供 packagePath、x、y、width 與 height;其餘可選參數使用預設值並轉呼叫最長 AddVideo 多載。
public OdfMediaObject AddVideo(string packagePath, OdfLength x, OdfLength y, OdfLength width, OdfLength height)
Parameters
Returns
AddVideo(string, OdfLength, OdfLength, OdfLength, OdfLength, string)
Adds a video object to the slide. 在投影片上新增影片物件。
public OdfMediaObject AddVideo(string packagePath, OdfLength x, OdfLength y, OdfLength width, OdfLength height, string mimeType)
Parameters
packagePathstringThe video path inside the package. / 影片在封裝包內的路徑。
xOdfLengthThe X-axis coordinate position. / X 軸座標位置。
yOdfLengthThe Y-axis coordinate position. / Y 軸座標位置。
widthOdfLengthThe width. / 寬度。
heightOdfLengthThe height. / 高度。
mimeTypestringThe video MIME type. / 影片 MIME 類型。
Returns
- OdfMediaObject
The newly created media object. / 新建立的媒體物件。
ApplyPresentationPageLayout(string)
Applies the presentation page layout with the specified name to this slide. 將指定名稱的投影片版面配置套用至此投影片。
public void ApplyPresentationPageLayout(string layoutName)
Parameters
layoutNamestringThe page layout name. / 版面配置名稱。
GetAnimations()
Gets the summary list of all animation effects on this slide. 取得此投影片上所有動畫效果的摘要清單。
public IReadOnlyList<OdfAnimationInfo> GetAnimations()
Returns
GetLayout()
Gets the layout type of this slide. 取得此投影片的版面配置型態。
public OdfPresentationLayout GetLayout()
Returns
- OdfPresentationLayout
The layout type. / 版面配置型態。
GetPlaceholderInfos()
Gets the summary list of all placeholders in the slide. 取得投影片中所有預留位置的摘要清單。
public IReadOnlyList<OdfPlaceholderInfo> GetPlaceholderInfos()
Returns
SetLayout(OdfPresentationLayout)
Sets the layout type of this slide and automatically arranges the corresponding placeholders. 設定此投影片的版面配置型態,並自動配置對應的預留位置。
public void SetLayout(OdfPresentationLayout layout)
Parameters
layoutOdfPresentationLayoutThe layout type. / 版面配置型態。
SetMasterPage(string)
Sets the master page name used by this slide. 設定此投影片使用的母片名稱。
public void SetMasterPage(string masterPageName)
Parameters
masterPageNamestringThe master page name. / 母片名稱。
SetSpeakerNotes(IEnumerable<string>)
Sets slide speaker notes as multiple paragraphs. 以多段落形式設定投影片備忘錄文字。
public OdfSlide SetSpeakerNotes(IEnumerable<string> paragraphs)
Parameters
paragraphsIEnumerable<string>The paragraph text collection. / 段落文字集合。
Returns
- OdfSlide
The current slide. / 目前投影片。
SetTransition(OdfTransitionType, OdfLength)
Sets the slide transition animation effect. 設定投影片切換動畫效果。
public void SetTransition(OdfTransitionType type, OdfLength duration)
Parameters
typeOdfTransitionTypeThe transition effect type. / 切換效果類型。
durationOdfLengthThe duration. / 持續時間。
SetTransition(OdfTransitionType, OdfLength, OdfTransitionSpeed)
Sets the slide transition animation effect and speed. 設定投影片切換動畫效果與速度。
public void SetTransition(OdfTransitionType type, OdfLength duration, OdfTransitionSpeed speed)
Parameters
typeOdfTransitionTypeThe transition effect type. / 切換效果類型。
durationOdfLengthThe duration. / 持續時間。
speedOdfTransitionSpeedThe transition speed. / 切換速度。