Class AttachedFile

Class AttachedFile

Nome do espaço: Aspose.Note Assembleia: Aspose.Note.dll (25.4.0)

Representa um arquivo anexado.

public class AttachedFile : Node, IPageChildNode, IOutlineElementChildNode, ITaggable, INode
   {
      private string _path;
      public string Path
      {
         get { return this._path; }
         set { this._path = value; }
      }
   }

Inheritance

object Node AttachedFile

Implements

IPageChildNode , IOutlineElementChildNode , ITaggable , INode

Membros herdados

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

Mostra como obter o conteúdo de um arquivo anexado.

string dataDir = RunExamples.GetDataDir_Attachments();
   Document oneFile = new Document(dataDir + "Sample1.one");
   IList<attachedfile> nodes = oneFile.GetChildNodes<attachedfile>();
   foreach (AttachedFile file in nodes)
   {
       using (Stream outputStream = new MemoryStream(file.Bytes))
       {
           using (System.IO.FileStream fileStream = System.IO.File.OpenWrite(String.Format(dataDir + file.FileName)))
           {
               CopyStream(outputStream, fileStream);
           }
       }
   }

Mostra como adicionar um arquivo a um documento usando o filepath.

string dataDir = RunExamples.GetDataDir_Attachments();
   Document doc = new Document();
   Aspose.Note.Page page = new Aspose.Note.Page(doc);
   Outline outline = new Outline(doc);
   OutlineElement outlineElem = new OutlineElement(doc);
   AttachedFile attachedFile = new AttachedFile(doc, dataDir + "attachment.txt");
   outlineElem.AppendChildLast(attachedFile);
   outline.AppendChildLast(outlineElem);
   page.AppendChildLast(outline);
   doc.AppendChildLast(page);
   dataDir += "AttachFileByPath_out.one";
   doc.Save(dataDir);

Mostra como adicionar um arquivo de um fluxo a um documento.

string dataDir = RunExamples.GetDataDir_Attachments();
   Document doc = new Document();
   Aspose.Note.Page page = new Aspose.Note.Page(doc);
   Outline outline = new Outline(doc);
   OutlineElement outlineElem = new OutlineElement(doc);
   using (var stream = File.OpenRead(dataDir + "icon.jpg"))
   {
       AttachedFile attachedFile = new AttachedFile(doc, dataDir + "attachment.txt", stream, ImageFormat.Jpeg);
       outlineElem.AppendChildLast(attachedFile);
   }
   outline.AppendChildLast(outlineElem);
   page.AppendChildLast(outline);
   doc.AppendChildLast(page);
   dataDir += "AttachFileAndSetIcon_out.one";
   doc.Save(dataDir);

Constructors

AttachedFile (string) e

Inicia uma nova instância da classe Aspose.Note.AttachedFile.

public AttachedFile(string path)
   {
   }

Parameters

path string

Uma linha que contém o caminho para o arquivo a partir do qual para criar o Aspose.Note.AttachedFile.

AttachedFile (string, Stream e ImageFormat)

Inicia uma nova instância da classe Aspose.Note.AttachedFile.

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

Parameters

path string

Uma linha que contém o caminho para o arquivo a partir do qual para criar o Aspose.Note.AttachedFile.

icon Stream

Um ícone para o arquivo anexado.

iconFormat ImageFormat

Um formato do ícone de arquivo anexado.

AttachedFile (string e Stream)

Inicia uma nova instância da classe Aspose.Note.AttachedFile.

public AttachedFile(string fileName, Stream attachedFileStream)
   {
   }

Parameters

fileName string

Um nome do arquivo anexado.

attachedFileStream Stream

Uma corrente que contém os bytes de arquivo anexados.

AttachedFile (string, Stream, stream, ImageFormat)

Inicia uma nova instância da classe Aspose.Note.AttachedFile.

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

Parameters

fileName string

Um nome do arquivo anexado.

attachedFileStream Stream

Uma corrente que contém os bytes de arquivo anexados.

icon Stream

Um ícone para o arquivo anexado.

iconFormat ImageFormat

Um formato do ícone de arquivo anexado.

Apresentação ( )

Inicia uma nova instância da classe Aspose.Note.AttachedFile.

public AttachedFile()
   {
   }

Properties

Alignment

Obtenha ou coloca o alinhamento.

public HorizontalAlignment Alignment
   {
      get;
      set;
   }

Valor da propriedade

HorizontalAlignment

AlternativeTextDescription

Recebe ou coloca um corpo um texto alternativo para o ícone do arquivo anexado.

public string AlternativeTextDescription
   {
      get;
      set;
   }

Valor da propriedade

string

AlternativeTextTitle

Recebe ou coloca um título de texto alternativo para o ícone do arquivo anexado.

public string AlternativeTextTitle
   {
      get;
      set;
   }

Valor da propriedade

string

Bytes

Obter os dados binários para um arquivo incorporado.

public byte[] Bytes
   {
      get;
   }

Valor da propriedade

byte [ ]

Examples

Mostra como obter o conteúdo de um arquivo anexado.

string dataDir = RunExamples.GetDataDir_Attachments();
   Document oneFile = new Document(dataDir + "Sample1.one");
   IList<attachedfile> nodes = oneFile.GetChildNodes<attachedfile>();
   foreach (AttachedFile file in nodes)
   {
       using (Stream outputStream = new MemoryStream(file.Bytes))
       {
           using (System.IO.FileStream fileStream = System.IO.File.OpenWrite(String.Format(dataDir + file.FileName)))
           {
               CopyStream(outputStream, fileStream);
           }
       }
   }

Extension

Recebe a extensão de um arquivo incorporado.

public string Extension
   {
      get;
   }

Valor da propriedade

string

FileName

Recebe o nome do arquivo incorporado.

public string FileName
   {
      get;
   }

Valor da propriedade

string

FilePath

Faça o caminho para o arquivo original.

public string FilePath
   {
      get;
   }

Valor da propriedade

string

Height

Obtenha a altura original do ícone de arquivo incorporado.

public float Height
   {
      get;
   }

Valor da propriedade

float

HorizontalOffset

Obtenha ou coloca o offset horizontal.

public float HorizontalOffset
   {
      get;
      set;
   }

Valor da propriedade

float

Icon

Recebe os dados binários para o ícone que está associado ao arquivo incorporado.

public byte[] Icon
   {
      get;
   }

Valor da propriedade

byte [ ]

IconExtension

Obter a extensão do ícone.

public string IconExtension
   {
      get;
   }

Valor da propriedade

string

IsPrintout

Recebe ou coloca um valor indicando se a visão do arquivo é impressa.

public bool IsPrintout
   {
      get;
      set;
   }

Valor da propriedade

bool

IsSizeSetByUser

Recebe ou coloca um valor indicando se o valor do tamanho do ícone foi explicitamente atualizado pelo usuário.

public bool IsSizeSetByUser
   {
      get;
      set;
   }

Valor da propriedade

bool

LastModifiedTime

Obter ou definir o último tempo modificado.

public DateTime LastModifiedTime
   {
      get;
      set;
   }

Valor da propriedade

DateTime

MaxHeight

Obter ou definir a altura máxima para exibir o ícone de arquivo incorporado.

public float MaxHeight
   {
      get;
      set;
   }

Valor da propriedade

float

MaxWidth

Obter ou definir a largura máxima para exibir o ícone de arquivo incorporado.

public float MaxWidth
   {
      get;
      set;
   }

Valor da propriedade

float

ParsingErrorInfo

Recebe os dados sobre o erro que ocorreu ao acessar o arquivo.

public ParsingErrorInfo ParsingErrorInfo
   {
      get;
   }

Valor da propriedade

ParsingErrorInfo

Tags

Obter a lista de todas as tags de um parágrafo.

public List<ITag> Tags { get; }

Valor da propriedade

List e o PT; ITag >

Text

Recebe ou coloca a representação de texto do arquivo incorporado. A faixa NÃO deve conter quaisquer caracteres do valor 10 (feito de linha) ou 13 (regresso de carga).

public string Text
   {
      get { return this._text; }
      set { this._text = value; }
   }
   private string _text;

Valor da propriedade

string

VerticalOffset

Recebe ou coloca a despensa vertical.

public float VerticalOffset
   {
      get;
      set;
   }

Valor da propriedade

float

Width

Obtenha a largura original do ícone de arquivo incorporado.

public float Width
   {
      get;
   }

Valor da propriedade

float

Methods

Acompanhamento (DocumentVisitor)

Acolhe o visitante do nodo.

public override void Accept(DocumentVisitor visitor)
   {
   }

Parameters

visitor DocumentVisitor

O objeto de uma classe derivado do Aspose.Note.DocumentVisitor.

 Português