public class Attachment extends Paragraph
Represents an attachment Paragraph
in a Pdf document. Attachment can be file attachment.
stream attachment or note annotation.
[Java] Pdf pdf1 = new Pdf(); Section sec1 = pdf1.getSections().add(); Attachment fileAttachment = new Attachment(); sec1.getParagraphs().add(fileAttachment); fileAttachment.setAttachmentType ( AttachmentType.File); fileAttachment.setAttachedFileName ( "c:/images/ccitt.tif"); fileAttachment.setAttachedFileType ( "tif"); fileAttachment.setFileIconType ( FileIconType.Graph); fileAttachment.setIconColor ( new com.aspose.pdf.generator.Color("Brown")); Attachment noteAttachment = new Attachment(); sec1.getParagraphs().add(noteAttachment); noteAttachment.setAttachmentType ( AttachmentType.Note); noteAttachment.setNoteContent ( "This is a note."); noteAttachment.setNoteHeading ( "this is a heading"); noteAttachment.isNoteOpen ( true); pdf1.save("test.pdf"); [XML] <?xml version="1.0" encoding="utf-8" ?> <Pdf xmlns="Aspose.Pdf"> <Section> <Attachment AttachmentType="File" AttachedFileName="c:/images/flower.jpg" AttachedFileType="jpeg" FileIconType="Graph" IconColor="Brown"> </Attachment> <Attachment AttachmentType="Note" IsNoteOpen="true" NoteContent="This is a note."> </Attachment> </Section> </Pdf>
Modifier and Type | Field and Description |
---|---|
int |
_AttachmentType
Gets or sets a
AttachmentType that indicates the attachment type. |
int |
_FileIconType
Gets or sets a
FileIconType that indicates the file attachment icon type. |
int |
_NoteIconType
Gets or sets a
NoteIconType that indicates the note icon type. |
int |
_NoteWindowPositioningType
Gets or sets a
NoteWindowPositioningType object that indicates the note window's
positioning type. |
String |
AttachedFileName
Gets or sets a string that indicates the attach file name.
|
String |
AttachedFileType
Gets or sets a string that indicates the MIME type of the attached file.
|
com.aspose.ms.System.IO.Stream |
AttachedStream
Gets or sets a stream attaches to the file.
|
Color |
IconColor
Represents a
Color object that indicates the color of the icon. |
boolean |
IsNoteOpen
Gets or sets a bool value that indicates whether the note is open or not when the Pdf document is opened.
|
String |
NoteContent
Gets or sets a string that indicates the content of the attached note.
|
String |
NoteHeading
Gets or sets a string that indicates the heading (title) of the attached note.
|
RectangleArea |
NoteWindowPosition
Gets or sets a
RectangleArea object that indicates the position of the note's
popup window. |
TextInfo |
TextInfo
Gets or sets a
TextInfo that indicates the attachment text info. |
_PositioningType, FixedHeight, FixedWidth, ID, IsDisabled, IsFirstParagraph, IsFirstParagraphInColumn, IsInList, IsKeptTogether, IsKeptWithNext, IsOnOddPage, Left, Margin, ReferenceParagraphID, Top
Constructor and Description |
---|
Attachment()
Initializes a new instance of the
Attachment class. |
Modifier and Type | Method and Description |
---|---|
Object |
completeClone()
Clones a new
Attachment object. |
copyTo, getBookmarked, setBookmarked
load
public TextInfo TextInfo
Gets or sets a TextInfo
that indicates the attachment text info.
public int _AttachmentType
Gets or sets a AttachmentType
that indicates the attachment type.
public String AttachedFileName
Gets or sets a string that indicates the attach file name.
public com.aspose.ms.System.IO.Stream AttachedStream
Gets or sets a stream attaches to the file.
public String AttachedFileType
Gets or sets a string that indicates the MIME type of the attached file.
public int _FileIconType
Gets or sets a FileIconType
that indicates the file attachment icon type.
public int _NoteWindowPositioningType
Gets or sets a NoteWindowPositioningType
object that indicates the note window's
positioning type. Default is Auto.
public RectangleArea NoteWindowPosition
Gets or sets a RectangleArea
object that indicates the position of the note's
popup window.
public String NoteContent
Gets or sets a string that indicates the content of the attached note.
public String NoteHeading
Gets or sets a string that indicates the heading (title) of the attached note.
public int _NoteIconType
Gets or sets a NoteIconType
that indicates the note icon type.
public boolean IsNoteOpen
Gets or sets a bool value that indicates whether the note is open or not when the Pdf document is opened.
public Color IconColor
Represents a Color
object that indicates the color of the icon.
public Attachment()
Initializes a new instance of the Attachment
class.
public Object completeClone()
Clones a new Attachment
object.
completeClone
in class Paragraph
Copyright © 2014 Aspose. All Rights Reserved.