Class AttachedFile

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(ストレーム、ストリーム、イメージフォーマット)

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(ストレーム、ストリーム、イメージフォーマット)

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; }

不動産価値

HorizontalAlignment

AlternativeTextDescription

接続されたファイルのアイコンに代替テキストを取得または設定します。

public string AlternativeTextDescription { get; set; }

不動産価値

string

AlternativeTextTitle

付属ファイルのアイコンに代替テキストのタイトルを取得または設定します。

public string AlternativeTextTitle { get; set; }

不動産価値

string

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; }

不動産価値

string

FileName

入力されたファイルの名前を入力します。

public string FileName { get; }

不動産価値

string

FilePath

オリジナルのファイルへの道のり。

public string FilePath { get; }

不動産価値

string

Height

組み込まれたファイルアイコンのオリジナルの高さを取得します。

public float Height { get; }

不動産価値

float

HorizontalOffset

ホリゾンタル・オフセットを取得または設定します。

public float HorizontalOffset { get; set; }

不動産価値

float

Icon

組み込まれたファイルと関連付けられているアイコンのバイナリーデータを取得します。

public byte[] Icon { get; }

不動産価値

byte ( )

IconExtension

アイコンの拡張を得る。

public string IconExtension { get; }

不動産価値

string

IsPrintout

ファイルの表示が印刷されているかどうかを示す値を取得または設定します。

public bool IsPrintout { get; set; }

不動産価値

bool

IsSizeSetByUser

アイコンのサイズの値がユーザーによって明示的に更新されたかどうかを示す値を取得または設定します。

public bool IsSizeSetByUser { get; set; }

不動産価値

bool

LastModifiedTime

最後に変更された時間を取得または設定します。

public DateTime LastModifiedTime { get; set; }

不動産価値

DateTime

MaxHeight

入力されたファイルアイコンを表示するために最大の高さを取得または設定します。

public float MaxHeight { get; set; }

不動産価値

float

MaxWidth

入力されたファイルアイコンを表示するために最大幅を取得または設定します。

public float MaxWidth { get; set; }

不動産価値

float

ParsingErrorInfo

ファイルにアクセスする際に発生したエラーに関するデータを取得します。

public ParsingErrorInfo ParsingErrorInfo { get; }

不動産価値

ParsingErrorInfo

Tags

1段落のすべてのタグのリストを取得します。

public List<itag> Tags { get; }

不動産価値

List < ITag >

Text

入力されたファイルのテキストプレゼンテーションを取得または設定します. 列には、10(ラインフィード)または13(送料返品)の文字が含まれません。

public string Text { get; set; }

不動産価値

string

VerticalOffset

受付または垂直割引を設定します。

public float VerticalOffset { get; set; }

不動産価値

float

Width

入力されたファイルアイコンのオリジナルの幅を取得します。

public float Width { get; }

不動産価値

float

Methods

Accept(DocumentVisitor)

ノードの訪問者を受け入れる。

public override void Accept(DocumentVisitor visitor)

Parameters

visitor DocumentVisitor

クラスのオブジェクトは Aspose.Note.DocumentVisitor から引き出されます。

 日本語