Class AttachedFile
ชื่อพื้นที่: Aspose.Note การประกอบ: Aspose.Note.dll (25.4.0)
แสดงไฟล์ที่แนบมา
public class AttachedFile : Node, IPageChildNode, IOutlineElementChildNode, ITaggable, INode
Inheritance
object ← Node ← AttachedFile
Implements
IPageChildNode , IOutlineElementChildNode , ITaggable , INode
อนุญาโตตุลาการ
Node.Accept(DocumentVisitor) , Node.Document , Node.IsComposite , Node.NodeType , Node.ParentNode , Node.PreviousSibling , Node.NextSibling , object.GetType() , object.MemberwiseClone() , object.ToString() , object.Equals(object?) , object.Equals(object?, object?) , object.ReferenceEquals(object?, object?) , object.GetHashCode()
Examples
แสดงวิธีรับเนื้อหาของไฟล์ที่แนบมา
// The path to the documents directory.
string dataDir = RunExamples.GetDataDir_Attachments();
// Load the document into Aspose.Note.
Document oneFile = new Document(dataDir + "Sample1.one");
// Get a list of attached file nodes
IList<attachedfile> nodes = oneFile.GetChildNodes<attachedfile>();
// Iterate through all nodes
foreach (AttachedFile file in nodes)
{
// Load attached file to a stream object
using (Stream outputStream = new MemoryStream(file.Bytes))
{
// Create a local file
using (Stream fileStream = System.IO.File.OpenWrite(String.Format(dataDir + file.FileName)))
{
// Copy file stream
CopyStream(outputStream, fileStream);
}
}
}</attachedfile></attachedfile>
แสดงวิธีเพิ่มไฟล์ไปยังเอกสารโดยใช้เส้นทางไฟล์
// The path to the documents directory.
string dataDir = RunExamples.GetDataDir_Attachments();
// Create an object of the Document class
Document doc = new Document();
// Initialize Page class object
Aspose.Note.Page page = new Aspose.Note.Page(doc);
// Initialize Outline class object
Outline outline = new Outline(doc);
// Initialize OutlineElement class object
OutlineElement outlineElem = new OutlineElement(doc);
// Initialize AttachedFile class object
AttachedFile attachedFile = new AttachedFile(doc, dataDir + "attachment.txt");
// Add attached file
outlineElem.AppendChildLast(attachedFile);
// Add outline element node
outline.AppendChildLast(outlineElem);
// Add outline node
page.AppendChildLast(outline);
// Add page node
doc.AppendChildLast(page);
dataDir = dataDir + "AttachFileByPath_out.one";
doc.Save(dataDir);
แสดงวิธีเพิ่มไฟล์จากกระแสไปยังเอกสาร
// The path to the documents directory.
string dataDir = RunExamples.GetDataDir_Attachments();
// Create an object of the Document class
Document doc = new Document();
// Initialize Page class object
Aspose.Note.Page page = new Aspose.Note.Page(doc);
// Initialize Outline class object
Outline outline = new Outline(doc);
// Initialize OutlineElement class object
OutlineElement outlineElem = new OutlineElement(doc);
using (var stream = File.OpenRead(dataDir + "icon.jpg"))
{
// Initialize AttachedFile class object and also pass its icon path
AttachedFile attachedFile = new AttachedFile(doc, dataDir + "attachment.txt", stream, ImageFormat.Jpeg);
// Add attached file
outlineElem.AppendChildLast(attachedFile);
}
// Add outline element node
outline.AppendChildLast(outlineElem);
// Add outline node
page.AppendChildLast(outline);
// Add page node
doc.AppendChildLast(page);
dataDir = dataDir + "AttachFileAndSetIcon_out.one";
doc.Save(dataDir);
Constructors
AttachedFile(รั้ว)
เปิดตัวตัวอย่างใหม่ของคลาส Aspose.Note.AttachedFile
public AttachedFile(string path)
Parameters
path
string
ลวดที่มีเส้นทางไปยังไฟล์จากที่สร้าง Aspose.Note.AttachedFile
AttachedFile(รั้ว, Stream, ImageFormat)
เปิดตัวตัวอย่างใหม่ของคลาส Aspose.Note.AttachedFile
public AttachedFile(string path, Stream icon, ImageFormat iconFormat)
Parameters
path
string
ลวดที่มีเส้นทางไปยังไฟล์จากที่สร้าง Aspose.Note.AttachedFile
icon
Stream
ไอคอนสําหรับไฟล์ที่แนบมา
iconFormat
ImageFormat
รูปแบบของไอคอนไฟล์ที่แนบมา
AttachedFile(กระแส, กระแส)
เปิดตัวตัวอย่างใหม่ของคลาส Aspose.Note.AttachedFile
public AttachedFile(string fileName, Stream attachedFileStream)
Parameters
fileName
string
ชื่อของไฟล์ที่แนบมา
attachedFileStream
Stream
กระแสที่มีไบต์ไฟล์ที่แนบมา
AttachedFile(กระแส, Stream, ImageFormat)
เปิดตัวตัวอย่างใหม่ของคลาส Aspose.Note.AttachedFile
public AttachedFile(string fileName, Stream attachedFileStream, Stream icon, ImageFormat iconFormat)
Parameters
fileName
string
ชื่อของไฟล์ที่แนบมา
attachedFileStream
Stream
กระแสที่มีไบต์ไฟล์ที่แนบมา
icon
Stream
ไอคอนสําหรับไฟล์ที่แนบมา
iconFormat
ImageFormat
รูปแบบของไอคอนไฟล์ที่แนบมา
AttachedFile()
เปิดตัวตัวอย่างใหม่ของคลาส Aspose.Note.AttachedFile
public AttachedFile()
Properties
Alignment
รับหรือตั้งค่าการปรับแต่ง
public HorizontalAlignment Alignment { get; set; }
คุณสมบัติมูลค่า
AlternativeTextDescription
ได้รับหรือตั้งค่าข้อความทางเลือกสําหรับไอคอนของไฟล์ที่แนบ
public string AlternativeTextDescription { get; set; }
คุณสมบัติมูลค่า
AlternativeTextTitle
รับหรือตั้งชื่อข้อความทางเลือกสําหรับไอคอนของไฟล์ที่แนบมา
public string AlternativeTextTitle { get; set; }
คุณสมบัติมูลค่า
Bytes
รับข้อมูลไบนารีสําหรับไฟล์ที่รวม
public byte[] Bytes { get; }
คุณสมบัติมูลค่า
byte [ ]
Examples
แสดงวิธีรับเนื้อหาของไฟล์ที่แนบมา
// The path to the documents directory.
string dataDir = RunExamples.GetDataDir_Attachments();
// Load the document into Aspose.Note.
Document oneFile = new Document(dataDir + "Sample1.one");
// Get a list of attached file nodes
IList<attachedfile> nodes = oneFile.GetChildNodes<attachedfile>();
// Iterate through all nodes
foreach (AttachedFile file in nodes)
{
// Load attached file to a stream object
using (Stream outputStream = new MemoryStream(file.Bytes))
{
// Create a local file
using (Stream fileStream = System.IO.File.OpenWrite(String.Format(dataDir + file.FileName)))
{
// Copy file stream
CopyStream(outputStream, fileStream);
}
}
}</attachedfile></attachedfile>
Extension
ได้รับการขยายของไฟล์ที่รวม
public string Extension { get; }
คุณสมบัติมูลค่า
FileName
รับชื่อของไฟล์ที่รวม
public string FileName { get; }
คุณสมบัติมูลค่า
FilePath
รับเส้นทางไปยังไฟล์เดิม
public string FilePath { get; }
คุณสมบัติมูลค่า
Height
ได้รับความสูงเดิมของไอคอนไฟล์ที่รวม
public float Height { get; }
คุณสมบัติมูลค่า
HorizontalOffset
รับหรือวางค่าธรรมเนียมแนวนอน
public float HorizontalOffset { get; set; }
คุณสมบัติมูลค่า
Icon
ได้รับข้อมูลไบนารีสําหรับไอคอนที่เชื่อมต่อกับไฟล์ที่รวม
public byte[] Icon { get; }
คุณสมบัติมูลค่า
byte [ ]
IconExtension
ได้รับการขยายของไอคอน
public string IconExtension { get; }
คุณสมบัติมูลค่า
IsPrintout
รับหรือตั้งค่าหมายความว่าภาพของไฟล์จะถูกพิมพ์ได้หรือไม่
public bool IsPrintout { get; set; }
คุณสมบัติมูลค่า
IsSizeSetByUser
รับหรือตั้งค่าหมายความว่าค่าของขนาดของไอคอนได้รับการปรับปรุงอย่างชัดเจนโดยผู้ใช้
public bool IsSizeSetByUser { get; set; }
คุณสมบัติมูลค่า
LastModifiedTime
ได้รับหรือตั้งค่าเวลาที่เปลี่ยนแปลงล่าสุด
public DateTime LastModifiedTime { get; set; }
คุณสมบัติมูลค่า
MaxHeight
รับหรือตั้งค่าความสูงสูงสุดเพื่อแสดงไอคอนไฟล์ที่รวม
public float MaxHeight { get; set; }
คุณสมบัติมูลค่า
MaxWidth
รับหรือตั้งค่าความกว้างสูงสุดเพื่อแสดงไอคอนไฟล์ที่รวม
public float MaxWidth { get; set; }
คุณสมบัติมูลค่า
ParsingErrorInfo
ได้รับข้อมูลเกี่ยวกับข้อผิดพลาดที่เกิดขึ้นเมื่อเข้าถึงไฟล์
public ParsingErrorInfo ParsingErrorInfo { get; }
คุณสมบัติมูลค่า
Tags
รับรายการแท็กทั้งหมดของ paragraph
public List<itag> Tags { get; }
คุณสมบัติมูลค่า
Text
รับหรือตั้งค่าการแสดงข้อความของไฟล์ที่รวม สี่เหลี่ยมไม่จําเป็นต้องมีตัวอักษรใด ๆ ของมูลค่า 10 (สายไฟ) หรือ 13 (การส่งคืน)
public string Text { get; set; }
คุณสมบัติมูลค่า
VerticalOffset
รับหรือวางค่าธรรมเนียมแนวตั้ง
public float VerticalOffset { get; set; }
คุณสมบัติมูลค่า
Width
ได้รับความกว้างเดิมของไอคอนไฟล์ที่รวม
public float Width { get; }
คุณสมบัติมูลค่า
Methods
Accept(DocumentVisitor)
ยินดีต้อนรับผู้เข้าชมของ node
public override void Accept(DocumentVisitor visitor)
Parameters
visitor
DocumentVisitor
วัตถุของชั้นที่มาจาก Aspose.Note.DocumentVisitor