Class AttachedFile

Class AttachedFile

Tên không gian: Aspose.Note Tổng hợp: Aspose.Note.dll (25.4.0)

Nó đại diện cho một tập tin được thêm vào.

public class AttachedFile : Node, IPageChildNode, IOutlineElementChildNode, ITaggable, INode
   {
      private string _path;
      public string Path
      {
         get { return this._path; }
         set { this._path = value; }
      }
   }

Inheritance

object Node AttachedFile

Implements

IPageChildNode , IOutlineElementChildNode , ITaggable , INode

Thành viên thừa kế

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

Hiển thị làm thế nào để có được nội dung của một tệp gắn kết.

string dataDir = RunExamples.GetDataDir_Attachments();
   Document oneFile = new Document(dataDir + "Sample1.one");
   IList<attachedfile> nodes = oneFile.GetChildNodes<attachedfile>();
   foreach (AttachedFile file in nodes)
   {
       using (Stream outputStream = new MemoryStream(file.Bytes))
       {
           using (System.IO.FileStream fileStream = System.IO.File.OpenWrite(String.Format(dataDir + file.FileName)))
           {
               CopyStream(outputStream, fileStream);
           }
       }
   }

Hiển thị cách thêm tệp vào một tài liệu bằng cách sử dụng filepath.

string dataDir = RunExamples.GetDataDir_Attachments();
   Document doc = new Document();
   Aspose.Note.Page page = new Aspose.Note.Page(doc);
   Outline outline = new Outline(doc);
   OutlineElement outlineElem = new OutlineElement(doc);
   AttachedFile attachedFile = new AttachedFile(doc, dataDir + "attachment.txt");
   outlineElem.AppendChildLast(attachedFile);
   outline.AppendChildLast(outlineElem);
   page.AppendChildLast(outline);
   doc.AppendChildLast(page);
   dataDir += "AttachFileByPath_out.one";
   doc.Save(dataDir);

Hiển thị cách thêm một tệp từ một dòng vào một tài liệu.

string dataDir = RunExamples.GetDataDir_Attachments();
   Document doc = new Document();
   Aspose.Note.Page page = new Aspose.Note.Page(doc);
   Outline outline = new Outline(doc);
   OutlineElement outlineElem = new OutlineElement(doc);
   using (var stream = File.OpenRead(dataDir + "icon.jpg"))
   {
       AttachedFile attachedFile = new AttachedFile(doc, dataDir + "attachment.txt", stream, ImageFormat.Jpeg);
       outlineElem.AppendChildLast(attachedFile);
   }
   outline.AppendChildLast(outlineElem);
   page.AppendChildLast(outline);
   doc.AppendChildLast(page);
   dataDir += "AttachFileAndSetIcon_out.one";
   doc.Save(dataDir);

Constructors

Lời bài hát: String

Bắt đầu một trường hợp mới của lớp Aspose.Note.AttachedFile.

public AttachedFile(string path)
   {
   }

Parameters

path string

Một dòng chứa con đường đến tệp từ đó để tạo Aspose.Note.AttachedFile.

AttachedFile (string, Stream, ImageFormat)

Bắt đầu một trường hợp mới của lớp Aspose.Note.AttachedFile.

public AttachedFile(string path, Stream icon, ImageFormat iconFormat)
   {
   }

Parameters

path string

Một dòng chứa con đường đến tệp từ đó để tạo Aspose.Note.AttachedFile.

icon Stream

Một biểu tượng cho tệp được thêm vào.

iconFormat ImageFormat

Một định dạng của biểu tượng tệp được gắn.

Tính năng: String, Stream

Bắt đầu một trường hợp mới của lớp Aspose.Note.AttachedFile.

public AttachedFile(string fileName, Stream attachedFileStream)
   {
   }

Parameters

fileName string

Một tên của tệp được gắn.

attachedFileStream Stream

Một dòng chứa các byte tệp được gắn.

AttachedFile(string, Stream, stream, ImageFormat)

Bắt đầu một trường hợp mới của lớp Aspose.Note.AttachedFile.

public AttachedFile(
       string fileName,
       Stream attachedFileStream,
       Stream icon,
       ImageFormat iconFormat)
   {
   }

Parameters

fileName string

Một tên của tệp được gắn.

attachedFileStream Stream

Một dòng chứa các byte tệp được gắn.

icon Stream

Một biểu tượng cho tệp được thêm vào.

iconFormat ImageFormat

Một định dạng của biểu tượng tệp được gắn.

Lời bài hát ( )

Bắt đầu một trường hợp mới của lớp Aspose.Note.AttachedFile.

public AttachedFile()
   {
   }

Properties

Alignment

Nhận hoặc đặt sự sắp xếp.

public HorizontalAlignment Alignment
   {
      get;
      set;
   }

Giá trị bất động sản

HorizontalAlignment

AlternativeTextDescription

Nhận hoặc đặt một văn bản thay thế cho biểu tượng của tệp được gắn.

public string AlternativeTextDescription
   {
      get;
      set;
   }

Giá trị bất động sản

string

AlternativeTextTitle

Nhận hoặc đặt một tiêu đề văn bản thay thế cho biểu tượng của tệp được gắn.

public string AlternativeTextTitle
   {
      get;
      set;
   }

Giá trị bất động sản

string

Bytes

Nhận dữ liệu nhị phân cho một tệp tích hợp.

public byte[] Bytes
   {
      get;
   }

Giá trị bất động sản

byte [ ]

Examples

Hiển thị làm thế nào để có được nội dung của một tệp gắn kết.

string dataDir = RunExamples.GetDataDir_Attachments();
   Document oneFile = new Document(dataDir + "Sample1.one");
   IList<attachedfile> nodes = oneFile.GetChildNodes<attachedfile>();
   foreach (AttachedFile file in nodes)
   {
       using (Stream outputStream = new MemoryStream(file.Bytes))
       {
           using (System.IO.FileStream fileStream = System.IO.File.OpenWrite(String.Format(dataDir + file.FileName)))
           {
               CopyStream(outputStream, fileStream);
           }
       }
   }

Extension

Nhận phần mở rộng của một tệp tích hợp.

public string Extension
   {
      get;
   }

Giá trị bất động sản

string

FileName

Nhận tên của tệp được nhúng.

public string FileName
   {
      get;
   }

Giá trị bất động sản

string

FilePath

Có được con đường đến tập tin ban đầu.

public string FilePath
   {
      get;
   }

Giá trị bất động sản

string

Height

Nhận chiều cao ban đầu của biểu tượng tệp nhúng.

public float Height
   {
      get;
   }

Giá trị bất động sản

float

HorizontalOffset

Nhận hoặc đặt offset ngang.

public float HorizontalOffset
   {
      get;
      set;
   }

Giá trị bất động sản

float

Icon

Nhận dữ liệu nhị phân cho biểu tượng được liên kết với tệp tích hợp.

public byte[] Icon
   {
      get;
   }

Giá trị bất động sản

byte [ ]

IconExtension

Nhận sự mở rộng của biểu tượng.

public string IconExtension
   {
      get;
   }

Giá trị bất động sản

string

IsPrintout

Nhận hoặc đặt một giá trị cho thấy xem tệp là in.

public bool IsPrintout
   {
      get;
      set;
   }

Giá trị bất động sản

bool

IsSizeSetByUser

Nhận hoặc đặt một giá trị cho thấy liệu giá của kích cỡ của biểu tượng đã được người dùng cập nhật rõ ràng hay không.

public bool IsSizeSetByUser
   {
      get;
      set;
   }

Giá trị bất động sản

bool

LastModifiedTime

Nhận hoặc đặt thời gian sửa đổi cuối cùng.

public DateTime LastModifiedTime
   {
      get;
      set;
   }

Giá trị bất động sản

DateTime

MaxHeight

Nhận hoặc đặt chiều cao tối đa để hiển thị biểu tượng tệp tích hợp.

public float MaxHeight
   {
      get;
      set;
   }

Giá trị bất động sản

float

MaxWidth

Nhận hoặc đặt chiều rộng tối đa để hiển thị biểu tượng tệp tích hợp.

public float MaxWidth
   {
      get;
      set;
   }

Giá trị bất động sản

float

ParsingErrorInfo

Nhận dữ liệu về lỗi xảy ra trong khi truy cập vào tệp.

public ParsingErrorInfo ParsingErrorInfo
   {
      get;
   }

Giá trị bất động sản

ParsingErrorInfo

Tags

Nhận danh sách tất cả các thẻ của một đoạn.

public List<ITag> Tags { get; }

Giá trị bất động sản

List < ITag >

Text

Nhận hoặc đặt biểu tượng văn bản của tệp được nhúng. dòng KHÔNG có chứa bất kỳ ký tự nào của giá trị 10 (một dòng nguồn) hoặc 13 (tái tải).

public string Text
   {
      get { return this._text; }
      set { this._text = value; }
   }
   private string _text;

Giá trị bất động sản

string

VerticalOffset

Nhận hoặc đặt bồi thường dọc.

public float VerticalOffset
   {
      get;
      set;
   }

Giá trị bất động sản

float

Width

Có được chiều rộng ban đầu của biểu tượng tệp nhúng.

public float Width
   {
      get;
   }

Giá trị bất động sản

float

Methods

Nhận (DocumentVisitor)

chấp nhận khách truy cập của nút.

public override void Accept(DocumentVisitor visitor)
   {
   }

Parameters

visitor DocumentVisitor

Đối tượng của một lớp được lấy từ Aspose.Note.DocumentVisitor.

 Tiếng Việt