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(String, Stream и 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, Strim i 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; }
Вредност имовине
AlternativeTextDescription
Добија или поставља тело алтернативном тексту за икону приложеног датотеке.
public string AlternativeTextDescription { get; set; }
Вредност имовине
AlternativeTextTitle
Добија или поставља наслов алтернативног текста за икону приложеног датотеке.
public string AlternativeTextTitle { get; set; }
Вредност имовине
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; }
Вредност имовине
FileName
Добије име уграђеног датотеке.
public string FileName { get; }
Вредност имовине
FilePath
Добијете пут до оригиналне датотеке.
public string FilePath { get; }
Вредност имовине
Height
Добија оригиналну висину уграђене иконе датотеке.
public float Height { get; }
Вредност имовине
HorizontalOffset
Добија или поставља хоризонталну попуст.
public float HorizontalOffset { get; set; }
Вредност имовине
Icon
Добија бинарне податке за икону која је повезана са уграђеним датотеком.
public byte[] Icon { get; }
Вредност имовине
byte []
IconExtension
Добија проширење иконе.
public string IconExtension { get; }
Вредност имовине
IsPrintout
Добија или поставља вредност која указује на то да ли је изглед датотеке штампано.
public bool IsPrintout { get; set; }
Вредност имовине
IsSizeSetByUser
Добија или поставља вредност која указује на то да ли је корисник изричито ажурирао вриједност величине иконе.
public bool IsSizeSetByUser { get; set; }
Вредност имовине
LastModifiedTime
Добија или поставља последње модификовано време.
public DateTime LastModifiedTime { get; set; }
Вредност имовине
MaxHeight
Добија или поставља максималну висину да би се приказивала икона уграђеног датотеке.
public float MaxHeight { get; set; }
Вредност имовине
MaxWidth
Добија или поставља максималну ширину да би се приказивала икона уграђеног датотеке.
public float MaxWidth { get; set; }
Вредност имовине
ParsingErrorInfo
Добијете податке о грешци која се догодила приликом приступа датотеку.
public ParsingErrorInfo ParsingErrorInfo { get; }
Вредност имовине
Tags
Добија листу свих ознака једног параграфа.
public List<itag> Tags { get; }
Вредност имовине
Text
Добије или поставља текстуалну репрезентацију уграђеног датотеке. редови НЕ треба да садрже никакве знакове вредности 10 (линија хране) или 13 (поновно враћање).
public string Text { get; set; }
Вредност имовине
VerticalOffset
Добија или поставља вертикалну попуст.
public float VerticalOffset { get; set; }
Вредност имовине
Width
Добија оригиналну ширину уграђене иконе датотеке.
public float Width { get; }
Вредност имовине
Methods
Accept(DocumentVisitor)
Прихвата посетиоца у чвору.
public override void Accept(DocumentVisitor visitor)
Parameters
visitor
DocumentVisitor
Објекат класе потиче из Aspose.Note.DocumentVisitor.