DocumentBuilder
ภาพรวม
DocumentBuilder เป็นคลาสใน Aspose.Words FOSS สำหรับ .NET. สืบทอดจาก: IRunAttrSource, IParaAttrSource, IRowAttrSource, และอีก 1 รายการ.
ให้เมธอดสำหรับแทรกข้อความ, รูปภาพและเนื้อหาอื่น, ระบุรูปแบบฟอนต์, ย่อหน้าและส่วน.
คลาสนี้ให้ 81 เมธอดสำหรับทำงานกับวัตถุ DocumentBuilder ในโปรแกรม .NET. เมธอดที่มี ได้แก่: DeleteRow, DocumentBuilder, EndBookmark, EndColumnBookmark, EndEditableRange, EndRow, EndTable, InsertBreak, InsertCell, InsertChart, InsertCheckBox, InsertComboBox, และเมธอดเพิ่มเติมอีก 36 รายการ. สมาชิกสาธารณะทั้งหมดเข้าถึงได้จากแอปพลิเคชัน .NET ใดก็ได้หลังจากติดตั้งแพคเกจ Aspose.Words FOSS สำหรับ .NET. คุณสมบัติ: Bold, CellFormat, CurrentNode, CurrentParagraph, CurrentSection, CurrentStory, และอีก 12 รายการ.
คุณสมบัติ
| ชื่อ | ประเภท | การเข้าถึง | คำอธิบาย |
|---|---|---|---|
Document | Document | อ่าน/เขียน | รับหรือกำหนดอ็อบเจ็กต์ Document ที่อ็อบเจ็กต์นี้แนบอยู่. |
Font | Font | อ่าน | คืนค่าอ็อบเจ็กต์ที่แสดงคุณสมบัติการจัดรูปแบบฟอนต์ปัจจุบัน. |
Bold | bool | อ่าน/เขียน | True หากฟอนต์ถูกจัดรูปแบบเป็นตัวหนา. |
Italic | bool | อ่าน/เขียน | True หากฟอนต์ถูกจัดรูปแบบเป็นตัวเอียง. |
Underline | Underline | อ่าน/เขียน | รับ/ตั้งค่าชนิดการขีดเส้นใต้สำหรับฟอนต์ปัจจุบัน. |
ParagraphFormat | ParagraphFormat | อ่าน | ส่งคืนอ็อบเจ็กต์ที่แสดงคุณสมบัติการจัดรูปแบบย่อหน้าปัจจุบัน. |
ListFormat | ListFormat | อ่าน | ส่งคืนอ็อบเจ็กต์ที่แสดงคุณสมบัติการจัดรูปแบบรายการปัจจุบัน. |
PageSetup | PageSetup | อ่าน | ส่งคืนอ็อบเจ็กต์ที่แสดงคุณสมบัติการตั้งค่าหน้าและส่วนปัจจุบัน. |
RowFormat | RowFormat | อ่าน | ส่งคืนอ็อบเจ็กต์ที่แสดงคุณสมบัติการจัดรูปแบบแถวของตารางปัจจุบัน. |
CellFormat | CellFormat | อ่าน | ส่งคืนอ็อบเจ็กต์ที่แสดงคุณสมบัติการจัดรูปแบบเซลล์ของตารางปัจจุบัน. |
IsAtStartOfParagraph | bool | อ่าน | คืนค่า true หากเคอร์เซอร์อยู่ที่จุดเริ่มต้นของย่อหน้าปัจจุบัน (ไม่มีข้อความก่อนเคอร์เซอร์). |
IsAtEndOfParagraph | bool | อ่าน | คืนค่า true หากเคอร์เซอร์อยู่ที่จุดสิ้นสุดของย่อหน้าปัจจุบัน. |
IsAtEndOfStructuredDocumentTag | bool | อ่าน | คืนค่า true หากเคอร์เซอร์อยู่ที่จุดสิ้นสุดของแท็กเอกสารที่มีโครงสร้าง. |
CurrentNode | Node | อ่าน | รับโหนดที่กำลังเลือกอยู่ใน DocumentBuilder นี้. |
CurrentParagraph | Paragraph | อ่าน | รับย่อหน้าที่กำลังเลือกอยู่ใน DocumentBuilder นี้. |
CurrentStructuredDocumentTag | StructuredDocumentTag | อ่าน | รับแท็กเอกสารเชิงโครงสร้างที่กำลังเลือกอยู่ใน DocumentBuilder นี้. |
CurrentStory | Story | อ่าน | รับเรื่องที่กำลังเลือกอยู่ใน DocumentBuilder นี้. |
CurrentSection | Section | อ่าน | รับส่วนที่กำลังเลือกอยู่ใน DocumentBuilder นี้. |
วิธีการ
| ลายเซ็น | คำอธิบาย |
|---|---|
DocumentBuilder() | เริ่มต้นอินสแตนซ์ใหม่ของคลาสนี้. |
DocumentBuilder(options: DocumentBuilderOptions) | เริ่มต้นอินสแตนซ์ใหม่ของคลาสนี้. |
DocumentBuilder(doc: Document) | สร้างอินสแตนซ์ใหม่ของคลาสนี้. |
DocumentBuilder(doc: Document, options: DocumentBuilderOptions) | สร้างอินสแตนซ์ใหม่ของคลาสนี้. |
MoveToDocumentStart() | ย้ายเคอร์เซอร์ไปยังจุดเริ่มต้นของเอกสาร. |
MoveToDocumentEnd() | ย้ายเคอร์เซอร์ไปยังจุดสิ้นสุดของเอกสาร. |
MoveToSection(sectionIndex: int) | ย้ายเคอร์เซอร์ไปยังจุดเริ่มต้นของเนื้อหาในส่วนที่ระบุ. |
MoveToHeaderFooter(headerFooterType: HeaderFooterType) | ย้ายเคอร์เซอร์ไปยังจุดเริ่มต้นของส่วนหัวหรือส่วนท้ายในส่วนปัจจุบัน. |
MoveToMergeField(fieldName: string) | ย้ายเคอร์เซอร์ไปยังฟิลด์รวมที่ระบุ. |
MoveToMergeField(fieldName: string, isAfter: bool, isDeleteField: bool) | ย้ายฟิลด์รวมไปยังฟิลด์รวมที่ระบุ. |
MoveToField(field: Field, isAfter: bool) | ย้ายเคอร์เซอร์ไปยังฟิลด์ในเอกสาร. |
MoveToBookmark(bookmarkName: string) | ย้ายเคอร์เซอร์ไปยังที่คั่นหน้า. |
MoveToBookmark(bookmarkName: string, isStart: bool, isAfter: bool) | ย้ายเคอร์เซอร์ไปยังที่คั่นหน้าด้วยความแม่นยำที่สูงขึ้น. |
MoveToParagraph(paragraphIndex: int, characterIndex: int) | ย้ายเคอร์เซอร์ไปยังย่อหน้าในส่วนปัจจุบัน. |
MoveToStructuredDocumentTag(structuredDocumentTagIndex: int, characterIndex: int) | ย้ายเคอร์เซอร์ไปยังแท็กเอกสารเชิงโครงสร้างในส่วนปัจจุบัน. |
MoveToStructuredDocumentTag(structuredDocumentTag: StructuredDocumentTag, characterIndex: int) | ย้ายเคอร์เซอร์ไปยังแท็กเอกสารเชิงโครงสร้าง. |
MoveToCell(tableIndex: int, rowIndex: int, columnIndex: int, characterIndex: int) | ย้ายเคอร์เซอร์ไปยังเซลล์ตารางในส่วนปัจจุบัน. |
MoveTo(node: Node) | ย้ายเคอร์เซอร์ไปยังโหนดแบบอินไลน์หรือไปยังจุดสิ้นสุดของย่อหน้า. |
DeleteRow(tableIndex: int, rowIndex: int) | ลบแถวจากตาราง. |
Write(text: string) | แทรกสตริงลงในเอกสารที่ตำแหน่งแทรกปัจจุบัน. |
Writeln(text: string) | แทรกสตริงและการขึ้นบรรทัดใหม่ลงในเอกสาร. |
Writeln() | แทรกการขึ้นบรรทัดใหม่ลงในเอกสาร. |
InsertParagraph() | แทรกการหยุดย่อหน้าในเอกสาร. |
InsertStructuredDocumentTag(type: SdtType) | แทรก StructuredDocumentTag ลงในเอกสาร. |
InsertStyleSeparator() | แทรกตัวคั่นสไตล์ลงในเอกสาร. |
InsertBreak(breakType: BreakType) | แทรกการหยุดตามประเภทที่ระบุลงในเอกสาร. |
InsertTableOfContents(switches: string) | แทรกฟิลด์ TOC (สารบัญ) ลงในเอกสาร. |
InsertField(fieldType: FieldType, updateField: bool) | แทรกฟิลด์ Word ลงในเอกสาร. |
InsertField(fieldCode: string) | แทรกฟิลด์ Word ลงในเอกสารและอัปเดตผลลัพธ์ของฟิลด์. |
InsertField(fieldCode: string, fieldValue: string) | แทรกฟิลด์ Word ลงในเอกสารโดยไม่อัปเดตผลลัพธ์ของฟิลด์. |
InsertHyperlink(displayText: string, urlOrBookmark: string, isBookmark: bool) | แทรกไฮเปอร์ลิงก์ลงในเอกสาร. |
InsertTextInput(name: string, type: TextFormFieldType, format: string, fieldValue: string, maxLength: int) | แทรกฟิลด์ฟอร์มข้อความที่ตำแหน่งปัจจุบัน. |
InsertCheckBox(name: string, checkedValue: bool, size: int) | แทรกฟิลด์ฟอร์มเช็คบ็อกซ์ที่ตำแหน่งปัจจุบัน. |
InsertCheckBox(name: string, defaultValue: bool, checkedValue: bool, size: int) | แทรกฟิลด์ฟอร์มเช็คบ็อกซ์ที่ตำแหน่งปัจจุบัน. |
InsertComboBox(name: string, items: string[], selectedIndex: int) | แทรกฟิลด์ฟอร์มคอมโบบ็อกซ์ที่ตำแหน่งปัจจุบัน. |
InsertFootnote(footnoteType: FootnoteType, footnoteText: string) | แทรกเชิงอรรถหรือเชิงอรรถท้ายในเอกสาร. |
InsertFootnote(footnoteType: FootnoteType, footnoteText: string, referenceMark: string) | แทรกเชิงอรรถหรือเชิงอรรถท้ายในเอกสาร. |
InsertImage(image: Image) | แทรกรูปภาพลงในเอกสาร. |
InsertImage(fileName: string) | แทรกรูปภาพจากไฟล์หรือ URL ลงในเอกสาร. |
InsertImage(stream: Stream) | เรียก InsertImage(stream) บนอินสแตนซ์ DocumentBuilder นี้. |
InsertImage(imageBytes: byte[]) | แทรกรูปภาพจากอาเรย์ไบต์ลงในเอกสาร. |
InsertImage(image: Image, width: double, height: double) | แทรกรูปภาพอินไลน์จากวัตถุ .NET ImageImageImage ลงในเอกสารและปรับขนาดให้เป็นขนาดที่ระบุ. |
InsertImage(fileName: string, width: double, height: double) | แทรกรูปภาพอินไลน์จากไฟล์หรือ URL ลงในเอกสารและปรับขนาดให้เป็นขนาดที่ระบุ. |
InsertImage(stream: Stream, width: double, height: double) | เรียกใช้ InsertImage(stream, width, height) บนอินสแตนซ์ DocumentBuilder นี้. |
InsertImage(imageBytes: byte[], width: double, height: double) | แทรกรูปภาพอินไลน์จาก byte array ลงในเอกสารและปรับขนาดให้เป็นขนาดที่ระบุ. |
InsertImage(image: Image, horzPos: RelativeHorizontalPosition, left: double, vertPos: RelativeVerticalPosition, top: double, width: double, height: double, wrapType: WrapType) | แทรกรูปภาพจากวัตถุ .NET ImageImageImage ที่ตำแหน่งและขนาดที่ระบุ. |
InsertImage(fileName: string, horzPos: RelativeHorizontalPosition, left: double, vertPos: RelativeVerticalPosition, top: double, width: double, height: double, wrapType: WrapType) | แทรกรูปภาพจากไฟล์หรือ URL ที่ตำแหน่งและขนาดที่ระบุ. |
InsertImage(stream: Stream, horzPos: RelativeHorizontalPosition, left: double, vertPos: RelativeVerticalPosition, top: double, width: double, height: double, wrapType: WrapType) | เรียก InsertImage(stream, horzPos, left, vertPos, top, width, height, wrapType) บนอินสแตนซ์ DocumentBuilder นี้. |
InsertImage(imageBytes: byte[], horzPos: RelativeHorizontalPosition, left: double, vertPos: RelativeVerticalPosition, top: double, width: double, height: double, wrapType: WrapType) | แทรกภาพจากอาร์เรย์ไบต์ที่ตำแหน่งและขนาดที่ระบุ. |
InsertForms2OleControl(forms2OleControl: Forms2OleControl) | แทรกอ็อบเจกต์ Forms2OleControl ไปยังตำแหน่งปัจจุบัน. |
InsertHtml(html: string) | แทรกสตริง HTML ลงในเอกสาร. |
InsertHtml(html: string, useBuilderFormatting: bool) | แทรกสตริง HTML ลงในเอกสาร. |
InsertHtml(html: string, options: HtmlInsertOptions) | แทรกสตริง HTML ลงในเอกสาร. |
InsertGroupShape(shapes) | จัดกลุ่มรูปทรงที่ส่งเป็นพารามิเตอร์เป็นโหนด GroupShape ใหม่ซึ่งจะถูกแทรกลงในตำแหน่งปัจจุบัน. |
InsertGroupShape(left: double, top: double, width: double, height: double, shapes) | จัดกลุ่มรูปทรงที่ส่งเป็นพารามิเตอร์เป็นโหนด GroupShape ใหม่ขนาดที่ระบุ ซึ่งจะถูกแทรกลงในตำแหน่งที่ระบุ. |
InsertChart(chartType: ChartType, width: double, height: double) | แทรก chart object ลงในเอกสารและปรับขนาดให้เป็นขนาดที่ระบุ. |
InsertChart(chartType: ChartType, width: double, height: double, chartStyle: ChartStyle) | แทรกวัตถุแผนภูมิลงในเอกสารและปรับขนาดให้เป็นขนาดที่ระบุ. |
InsertChart(chartType: ChartType, horzPos: RelativeHorizontalPosition, left: double, vertPos: RelativeVerticalPosition, top: double, width: double, height: double, wrapType: WrapType) | แทรกวัตถุแผนภูมิลงในเอกสารและปรับขนาดให้เป็นขนาดที่ระบุ. |
InsertChart(chartType: ChartType, horzPos: RelativeHorizontalPosition, left: double, vertPos: RelativeVerticalPosition, top: double, width: double, height: double, wrapType: WrapType, chartStyle: ChartStyle) | แทรกวัตถุแผนภูมิลงในเอกสารและปรับขนาดให้เป็นขนาดที่ระบุ. |
InsertOnlineVideo(videoUrl: string, width: double, height: double) | แทรกวัตถุวิดีโอออนไลน์ลงในเอกสารและปรับขนาดให้เป็นขนาดที่ระบุ. |
InsertOnlineVideo(videoUrl: string, horzPos: RelativeHorizontalPosition, left: double, vertPos: RelativeVerticalPosition, top: double, width: double, height: double, wrapType: WrapType) | แทรกวิดีโอออนไลน์ลงในเอกสารและปรับขนาดให้เป็นตามขนาดที่ระบุ. |
InsertOnlineVideo(videoUrl: string, videoEmbedCode: string, thumbnailImageBytes: byte[], width: double, height: double) | แทรกวิดีโอออนไลน์ลงในเอกสารและปรับขนาดให้เป็นตามขนาดที่ระบุ. |
InsertOnlineVideo(videoUrl: string, videoEmbedCode: string, thumbnailImageBytes: byte[], horzPos: RelativeHorizontalPosition, left: double, vertPos: RelativeVerticalPosition, top: double, width: double, height: double, wrapType: WrapType) | แทรกวิดีโอออนไลน์ลงในเอกสารและปรับขนาดให้เป็นตามขนาดที่ระบุ. |
InsertHorizontalRule() | แทรกรูปร่างเส้นแนวนอนลงในเอกสาร. |
InsertCell() | แทรกเซลล์ตารางลงในเอกสาร. |
StartTable() | เริ่มต้นตารางในเอกสาร. |
EndTable() | จบตารางในเอกสาร. |
EndRow() | จบแถวตารางในเอกสาร. |
StartBookmark(bookmarkName: string) | ทำเครื่องหมายตำแหน่งปัจจุบันในเอกสารเป็นการเริ่มต้นของ bookmark. |
EndBookmark(bookmarkName: string) | ทำเครื่องหมายตำแหน่งปัจจุบันในเอกสารเป็นการสิ้นสุดของ bookmark. |
StartColumnBookmark(bookmarkName: string) | ทำเครื่องหมายตำแหน่งปัจจุบันในเอกสารเป็นการเริ่มต้นของ column bookmark. |
EndColumnBookmark(bookmarkName: string) | ทำเครื่องหมายตำแหน่งปัจจุบันในเอกสารเป็นการสิ้นสุดของ column bookmark. |
StartEditableRange() | ทำเครื่องหมายตำแหน่งปัจจุบันในเอกสารเป็นจุดเริ่มต้นของช่วงที่แก้ไขได้. |
EndEditableRange() | ทำเครื่องหมายตำแหน่งปัจจุบันในเอกสารว่าเป็นจุดสิ้นสุดของช่วงที่สามารถแก้ไขได้. |
EndEditableRange(start: EditableRangeStart) | ทำเครื่องหมายตำแหน่งปัจจุบันในเอกสารว่าเป็นจุดสิ้นสุดของช่วงที่สามารถแก้ไขได้. |
InsertDocument(srcDoc: Document, importFormatMode: ImportFormatMode) | แทรกเอกสารที่ตำแหน่งของเคอร์เซอร์. |
InsertDocument(srcDoc: Document, importFormatMode: ImportFormatMode, importFormatOptions: ImportFormatOptions) | แทรกเอกสารที่ตำแหน่งของเคอร์เซอร์. |
InsertDocumentInline(srcDoc: Document, importFormatMode: ImportFormatMode, importFormatOptions: ImportFormatOptions) | แทรกเอกสารแบบอินไลน์ที่ตำแหน่งเคอร์เซอร์. |
PushFont() | บันทึกการจัดรูปแบบอักขระปัจจุบันลงบนสแตก. |
PopFont() | ดึงการจัดรูปแบบอักขระที่บันทึกไว้ก่อนหน้านี้จากสแตก. |
InsertNode(node: Node) | แทรกโหนดก่อนเคอร์เซอร์. |