public class DocumentAttachment extends Paragraph
Represents a set of document level attachment Paragraph
in a Pdf document. Attachment can be file attachment,
stream attachment or note annotation.
[C#] Pdf pdf1 = new Pdf(); Section sec1 = pdf1.Sections.Add(); FileStream fstream; fstream = new FileStream("c:/word.doc", FileMode.Open); DocumentAttachment DocStreamAttachment = new DocumentAttachment(); pdf1.DocumentAttachments.Add(DocStreamAttachment); DocStreamAttachment.DocumentAttachmentStream = fstream; DocStreamAttachment.DocumentAttachmentCotentType = "doc"; DocumentAttachment DocFileAttachment = new DocumentAttachment(); pdf1.DocumentAttachments.Add(DocFileAttachment); DocFileAttachment.DocumentAttachmentFile = @"c:/image.jpg"; DocFileAttachment.DocumentAttachmentCotentType = "jpeg"; Attachment PageFileAttachment = new Attachment(); sec1.Paragraphs.Add(PageFileAttachment); PageFileAttachment.AttachmentType = AttachmentType.File; PageFileAttachment.AttachedFileName = "c:/text.txt"; PageFileAttachment.AttachedFileType = "txt"; PageFileAttachment.FileIconType = FileIconType.Graph; PageFileAttachment.IconColor = new Aspose.Pdf.Generator.Color("Brown"); fstream = new FileStream("c:/readme.txt", FileMode.Open); Attachment PageStreamAttachment = new Attachment(); sec1.Paragraphs.Add(PageStreamAttachment); PageStreamAttachment.AttachedStream = fstream; PageStreamAttachment.AttachedFileType = "txt"; PageStreamAttachment.AttachmentType = AttachmentType.File; PageStreamAttachment.FileIconType = FileIconType.PaperClip; Attachment PageNoteAttachment = new Attachment(); sec1.Paragraphs.Add(PageNoteAttachment); PageNoteAttachment.AttachmentType = AttachmentType.Note; PageNoteAttachment.NoteContent = "This is a note."; PageNoteAttachment.IsNoteOpen = true; pdf1.Save("test.pdf"); [Visual Basic] Dim pdf1 As Pdf = New Pdf() Dim sec1 As Section = pdf1.Sections.Add() Dim fstream As FileStream = new FileStream("c:/word.doc", FileMode.Open) Dim DocStreamAttachment As DocumentAttachment = New DocumentAttachment() pdf1.DocumentAttachments.Add(DocStreamAttachment) DocStreamAttachment.DocumentAttachmentStream = fstream DocStreamAttachment.DocumentAttachmentCotentType = "doc" Dim DocFileAttachment As DocumentAttachment = New DocumentAttachment() pdf1.DocumentAttachments.Add(DocFileAttachment) DocFileAttachment.DocumentAttachmentFile = @"c:/image.jpg" DocFileAttachment.DocumentAttachmentCotentType = "jpeg" Dim PageFileAttachment As Attachment = New Attachment() sec1.Paragraphs.Add(PageFileAttachment) PageFileAttachment.AttachmentType = AttachmentType.File PageFileAttachment.AttachedFileName = "c:/text.txt" PageFileAttachment.AttachedFileType = "txt" PageFileAttachment.FileIconType = FileIconType.Graph PageFileAttachment.IconColor = new Aspose.Pdf.Generator.Color("Brown") fstream = new FileStream("c:/readme.txt", FileMode.Open) Dim PageStreamAttachment As Attachment = New Attachment() sec1.Paragraphs.Add(PageStreamAttachment) PageStreamAttachment.AttachedStream = fstream PageStreamAttachment.AttachedFileType = "txt" PageStreamAttachment.AttachmentType = AttachmentType.File PageStreamAttachment.FileIconType = FileIconType.PaperClip Dim PageNoteAttachment As Attachment = New Attachment() sec1.Paragraphs.Add(PageNoteAttachment) PageNoteAttachment.AttachmentType = AttachmentType.Note PageNoteAttachment.NoteContent = "This is a note." PageNoteAttachment.IsNoteOpen = true pdf1.Save("test.pdf") [XML] <?xml version="1.0" encoding="utf-8" ?> <Pdf xmlns="Aspose.Pdf"> <DocumentAttachment DocumentAttachmentFileName="c:/word.doc" DocumentAttachmentFileType="doc"> </DocumentAttachment> <DocumentAttachment DocumentAttachmentFileName="c:/image.jpg" DocumentAttachmentFileType="jpeg"> </DocumentAttachment> <Section> <Attachment AttachmentType="File" AttachedFileName="c:/text.txt" AttachedFileType="txt" FileIconType="Graph" IconColor="Brown"> </Attachment> <Attachment AttachmentType="File" AttachedFileName="c:/readme.txt" AttachedFileType="txt" FileIconType="PaperClip"> </Attachment> <Attachment AttachmentType="Note" IsNoteOpen="true" NoteContent="This is a note."> </Attachment> </Section> </Pdf>
Paragraph.VerticalPositionInfo
absolutePosX, absolutePosY, ClippingArea, FixedHeight, FixedWidth, isAbsoluteLayout, isFixedLayout, IsNeedAddToPage, IsPositionGot, IsPositionProcessed, isRelativeLayout, MayNeedReprocess, NextParagraph, posBottom, posLeft, posRight, posTop, RefPara, relativePosX, relativePosY, VerticalPosInfo
Constructor and Description |
---|
DocumentAttachment()
Initializes a new instance of the
DocumentAttachment class. |
Modifier and Type | Method and Description |
---|---|
Object |
completeClone() |
Object |
deepClone() |
String |
getDocumentAttachmentContentType()
Gets or sets a string that indicates the MIME type of the attached file.
|
String |
getDocumentAttachmentFile()
Gets or sets a string that indicates the DocumentAttachment file name.
|
InputStream |
getDocumentAttachmentStream() |
com.aspose.ms.System.IO.Stream |
getDocumentAttachmentStreamInternal() |
void |
setDocumentAttachmentContentType(String value) |
void |
setDocumentAttachmentFile(String value) |
void |
setDocumentAttachmentStream(InputStream value) |
void |
setDocumentAttachmentStreamInternal(com.aspose.ms.System.IO.Stream value) |
copyTo, getBookmarked, getComposer, getFootNoteProcessed, getHeight, getID, getLeft, getMargin, getNeedReprocess, getNextParagraphInHeading, getPageNumber, getParentCell, getPositioningType, getPosX, getPosY, getRealPageNumber, getReferencedParagraphWidth, getReferenceParagraphID, getRefPageNumber, getSection, getTop, getWidth, isDisabled, isDisabled, isEndNote, isFirstParagraph, isFirstParagraph, isFirstParagraphInColumn, isFirstParagraphInColumn, isFootNote, isFootNote, isInHeaderFooter, isInHeaderFooter, isInList, isInList, isKeptTogether, isKeptTogether, isKeptWithNext, isKeptWithNext, isOnOddPage, isOnOddPage, setBookmarked, setFootNoteProcessed, setHeight, setID, setLeft, setMargin, setNeedReprocess, setNextParagraphInHeading, setPageNumber, setParentCell, setParentIsTable, setPositioningType, setPosX, setPosY, setRealPageNumber, setReferencedParagraphWidth, setReferenceParagraphID, setRefPageNumber, setSection, setTop, setWidth
public DocumentAttachment()
Initializes a new instance of the DocumentAttachment
class.
public String getDocumentAttachmentFile()
Gets or sets a string that indicates the DocumentAttachment file name.
public void setDocumentAttachmentFile(String value)
public com.aspose.ms.System.IO.Stream getDocumentAttachmentStreamInternal()
public InputStream getDocumentAttachmentStream()
public void setDocumentAttachmentStreamInternal(com.aspose.ms.System.IO.Stream value)
public void setDocumentAttachmentStream(InputStream value)
public String getDocumentAttachmentContentType()
Gets or sets a string that indicates the MIME type of the attached file. When
public void setDocumentAttachmentContentType(String value)
public Object completeClone()
completeClone
in class Paragraph
public Object deepClone()
Copyright © 2016 Aspose. All Rights Reserved.