Class AttachedFile

Class AttachedFile

De naam: Aspose.Note Verzameling: Aspose.Note.dll (25.4.0)

Vertegenwoordigt een aangesloten bestand.

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

Inheritance

object Node AttachedFile

Implements

IPageChildNode , IOutlineElementChildNode , ITaggable , INode

Geëerbiede leden

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

Toon hoe u de inhoud van een bijgevoegde bestand krijgt.

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

Toon hoe u een bestand toevoegt aan een document met behulp van de 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);

Toon hoe u een bestand van een stroom toevoegt aan een document.

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

Initialiseert een nieuwe instantie van de Aspose.Note.AttachedFile klasse.

public AttachedFile(string path)

Parameters

path string

Een rij die de route bevat naar de bestand waaruit u de Aspose.Note.AttachedFile kunt maken.

AttachedFile(String, Stream en ImageFormat)

Initialiseert een nieuwe instantie van de Aspose.Note.AttachedFile klasse.

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

Parameters

path string

Een rij die de route bevat naar de bestand waaruit u de Aspose.Note.AttachedFile kunt maken.

icon Stream

Een icoon voor de aangesloten bestand.

iconFormat ImageFormat

Een formaat van de bijgevoegde bestand icon.

AttachedFile(Stream , Stream)

Initialiseert een nieuwe instantie van de Aspose.Note.AttachedFile klasse.

public AttachedFile(string fileName, Stream attachedFileStream)

Parameters

fileName string

Een naam van de aangesloten bestand.

attachedFileStream Stream

Een stroom die de bijgevoegde bestand byten bevat.

AttachedFile(String, Stream en ImageFormat)

Initialiseert een nieuwe instantie van de Aspose.Note.AttachedFile klasse.

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

Parameters

fileName string

Een naam van de aangesloten bestand.

attachedFileStream Stream

Een stroom die de bijgevoegde bestand byten bevat.

icon Stream

Een icoon voor de aangesloten bestand.

iconFormat ImageFormat

Een formaat van de bijgevoegde bestand icon.

AttachedFile()

Initialiseert een nieuwe instantie van de Aspose.Note.AttachedFile klasse.

public AttachedFile()

Properties

Alignment

Geeft of zet de aanpassing.

public HorizontalAlignment Alignment { get; set; }

Eigendomswaarde

HorizontalAlignment

AlternativeTextDescription

Geeft of stelt een lichaam een alternatieve tekst voor het icoon van de bijgevoegde bestand.

public string AlternativeTextDescription { get; set; }

Eigendomswaarde

string

AlternativeTextTitle

Geeft of stelt een titel van alternatieve tekst voor het icoon van de bijgevoegde bestand.

public string AlternativeTextTitle { get; set; }

Eigendomswaarde

string

Bytes

Geeft de binaire gegevens voor een ingebouwde bestand.

public byte[] Bytes { get; }

Eigendomswaarde

byte []

Examples

Toon hoe u de inhoud van een bijgevoegde bestand krijgt.

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

Het krijgt de uitbreiding van een ingebouwde bestand.

public string Extension { get; }

Eigendomswaarde

string

FileName

Neem de naam van de ingebouwde bestand.

public string FileName { get; }

Eigendomswaarde

string

FilePath

Geeft de weg naar het originele bestand.

public string FilePath { get; }

Eigendomswaarde

string

Height

Geeft de oorspronkelijke hoogte van de ingebouwde bestand icon.

public float Height { get; }

Eigendomswaarde

float

HorizontalOffset

Geeft of zet de horizontale offset.

public float HorizontalOffset { get; set; }

Eigendomswaarde

float

Icon

Geeft de binaire gegevens voor het icoon dat is geassocieerd met de ingebouwde bestand.

public byte[] Icon { get; }

Eigendomswaarde

byte []

IconExtension

Geeft de uitbreiding van de icon.

public string IconExtension { get; }

Eigendomswaarde

string

IsPrintout

Geeft of stelt een waarde aan die aanwijst of de weergave van de bestand wordt gedrukt.

public bool IsPrintout { get; set; }

Eigendomswaarde

bool

IsSizeSetByUser

ontvangt of instelt een waarde die aangeeft of de waarde van de grootte van het icoon uitdrukkelijk is bijgewerkt door de gebruiker.

public bool IsSizeSetByUser { get; set; }

Eigendomswaarde

bool

LastModifiedTime

Geeft of stelt de laatste gewijzigde tijd.

public DateTime LastModifiedTime { get; set; }

Eigendomswaarde

DateTime

MaxHeight

Geeft of stelt de maximale hoogte om de ingebouwde bestand icon te tonen.

public float MaxHeight { get; set; }

Eigendomswaarde

float

MaxWidth

Geeft of stelt de maximale breedte om het ingebouwde bestandicon te weergeven.

public float MaxWidth { get; set; }

Eigendomswaarde

float

ParsingErrorInfo

Geeft de gegevens over de fout die zich heeft voorgedaan tijdens de toegang tot het bestand.

public ParsingErrorInfo ParsingErrorInfo { get; }

Eigendomswaarde

ParsingErrorInfo

Tags

Geeft de lijst van alle tags van een paragraaf.

public List<itag> Tags { get; }

Eigendomswaarde

List < ITag >

Text

Geeft of stelt de tekstrepresentatie van de ingebouwde bestand. De string MUST NOT contain any characters of the value 10 (line feed) or 13 (carriage return).

public string Text { get; set; }

Eigendomswaarde

string

VerticalOffset

Geeft of zet de verticale offset.

public float VerticalOffset { get; set; }

Eigendomswaarde

float

Width

Geeft de oorspronkelijke breedte van de ingebouwde bestand icoon.

public float Width { get; }

Eigendomswaarde

float

Methods

Accept(DocumentVisitor)

Accepteert de bezoeker van de node.

public override void Accept(DocumentVisitor visitor)

Parameters

visitor DocumentVisitor

Het object van een klasse is afgeleid van de Aspose.Note.DocumentVisitor.

 Nederlands