Class AttachedFile

Class AttachedFile

nazivni prostor: Aspose.Note Sastav: Aspose.Note.dll (25.4.0)

Predstavlja priključenu datoteku.

public class AttachedFile : Node, IPageChildNode, IOutlineElementChildNode, ITaggable, INode

Inheritance

object Node AttachedFile

Implements

IPageChildNode , IOutlineElementChildNode , ITaggable , INode

naslijeđeni članovi

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

Pokaže kako dobiti sadržaj priključenog datoteke.

// 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>

Prikazuje kako dodati datoteku u dokument pomoću FilePath.

// 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);

Pokaže kako dodati datoteku iz struje u dokument.

// 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)

Inicijalizira novu primjenu Aspose.Note.AttachedFile klase.

public AttachedFile(string path)

Parameters

path string

Priključak koji sadrži put do datoteke iz kojeg stvoriti Aspose.Note.AttachedFile.

AttachedFile(String, Stream i ImageFormat)

Inicijalizira novu primjenu Aspose.Note.AttachedFile klase.

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

Parameters

path string

Priključak koji sadrži put do datoteke iz kojeg stvoriti Aspose.Note.AttachedFile.

icon Stream

Ikon za priključenu datoteku.

iconFormat ImageFormat

Format priključenog ikona datoteke.

AttachedFile(Slijedeći Članak Stream)

Inicijalizira novu primjenu Aspose.Note.AttachedFile klase.

public AttachedFile(string fileName, Stream attachedFileStream)

Parameters

fileName string

Ime priključenog datoteke.

attachedFileStream Stream

Stream koji sadrži priključene datoteke.

AttachedFile(String, Stream, Svijet, Obrazac)

Inicijalizira novu primjenu Aspose.Note.AttachedFile klase.

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

Parameters

fileName string

Ime priključenog datoteke.

attachedFileStream Stream

Stream koji sadrži priključene datoteke.

icon Stream

Ikon za priključenu datoteku.

iconFormat ImageFormat

Format priključenog ikona datoteke.

AttachedFile()

Inicijalizira novu primjenu Aspose.Note.AttachedFile klase.

public AttachedFile()

Properties

Alignment

Uzmite ili postavite usklađenost.

public HorizontalAlignment Alignment { get; set; }

Vrijednost nekretnina

HorizontalAlignment

AlternativeTextDescription

Dobiva ili postavlja tijelo alternativnim tekstom za ikonu priložene datoteke.

public string AlternativeTextDescription { get; set; }

Vrijednost nekretnina

string

AlternativeTextTitle

Dobiva ili postavlja naslov alternativnog teksta za ikonu priložene datoteke.

public string AlternativeTextTitle { get; set; }

Vrijednost nekretnina

string

Bytes

Dobiva binarne podatke za ugrađene datoteke.

public byte[] Bytes { get; }

Vrijednost nekretnina

byte []

Examples

Pokaže kako dobiti sadržaj priključenog datoteke.

// 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

Dobiva proširenje ugrađenog datoteke.

public string Extension { get; }

Vrijednost nekretnina

string

FileName

Pronađite ime ugrađenog datoteke.

public string FileName { get; }

Vrijednost nekretnina

string

FilePath

Pronađite put do izvornog datoteke.

public string FilePath { get; }

Vrijednost nekretnina

string

Height

Dobiva originalnu visinu ugrađenog ikona datoteke.

public float Height { get; }

Vrijednost nekretnina

float

HorizontalOffset

Uzmite ili postavite horizontalni popust.

public float HorizontalOffset { get; set; }

Vrijednost nekretnina

float

Icon

Dobiva binarne podatke za ikonu koja je povezana s ugrađenim datotekom.

public byte[] Icon { get; }

Vrijednost nekretnina

byte []

IconExtension

Pronađite proširenje ikone.

public string IconExtension { get; }

Vrijednost nekretnina

string

IsPrintout

Dobiva ili postavlja vrijednost koja ukazuje na to je li pogled datoteke tiskan.

public bool IsPrintout { get; set; }

Vrijednost nekretnina

bool

IsSizeSetByUser

Dobiva ili postavlja vrijednost koja ukazuje na to je li korisnik izričito ažurirao vrednost veličine ikone.

public bool IsSizeSetByUser { get; set; }

Vrijednost nekretnina

bool

LastModifiedTime

Pronađite ili postavite posljednje izmijenjene vrijeme.

public DateTime LastModifiedTime { get; set; }

Vrijednost nekretnina

DateTime

MaxHeight

Pronađite ili postavite maksimalnu visinu kako biste prikazali ikonu ugrađenog datoteke.

public float MaxHeight { get; set; }

Vrijednost nekretnina

float

MaxWidth

Pronađite ili postavite maksimalnu širinu kako biste prikazali ugrađenu ikonu datoteke.

public float MaxWidth { get; set; }

Vrijednost nekretnina

float

ParsingErrorInfo

Dobiva podatke o pogrešci koja se dogodila prilikom pristupa datoteci.

public ParsingErrorInfo ParsingErrorInfo { get; }

Vrijednost nekretnina

ParsingErrorInfo

Tags

Pronađite popis svih oznaka jednog stavka.

public List<itag> Tags { get; }

Vrijednost nekretnina

List < ITag >

Text

Pronađite ili postavite tekstnu reprezentaciju ugrađenog datoteke. red ne smije sadržavati nikakve znakove vrijednosti 10 (line feed) ili 13 (povratak tereta).

public string Text { get; set; }

Vrijednost nekretnina

string

VerticalOffset

Uzmite ili postavite vertikalni popust.

public float VerticalOffset { get; set; }

Vrijednost nekretnina

float

Width

Dobiva originalnu širinu ugrađenog ikona datoteke.

public float Width { get; }

Vrijednost nekretnina

float

Methods

Accept(DocumentVisitor)

Prihvaćaju posjetitelja čvorova.

public override void Accept(DocumentVisitor visitor)

Parameters

visitor DocumentVisitor

Objekt klase koji proizlazi iz Aspose.Note.DocumentVisitor.

 Hrvatski