Class AttachedFile

Class AttachedFile

نام ها : Aspose.Note جمع آوری: WL31_.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(String)

یک مثال جدید از کلاس Aspose.Note.AttachedFile را آغاز می کند.

public AttachedFile(string path)

Parameters

path string

یک نوار که حاوی مسیر به فایل است که از آن برای ایجاد Aspose.Note.AttachedFile.

AttachedFile(String، جریان، 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(String، 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; }

ارزش املاک

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

لیست تمام برچسب های یک پاراگراف را دریافت کنید.

public List<itag> Tags { get; }

ارزش املاک

List &lt؛ 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 گرفته شده است.

 فارسی