aspose.pdf
Class Attachment

java.lang.Object
  extended by aspose.pdf.Paragraph
      extended by aspose.pdf.Attachment

public class Attachment
extends Paragraph

Represents an attachment Paragraph in a Pdf document. Attachment can be file attachment, stream attachment or note annotation.

Typical usages are the following:

[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.jpg"); fileAttachment.setAttachedFileType("tif"); fileAttachment.setFileIconType(FileIconType.Graph); fileAttachment.setIconColor(new aspose.pdf.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.setIsNoteOpen(true); pdf1.save("test.pdf"); [XML] <?xml version="1.0" encoding="utf-8" ?> <Pdf xmlns="Aspose.Pdf"> <Section> <Attachment AttachmentType="File" AttachedFileName="c:/images/ccitt.jpg" AttachedFileType="jpeg" FileIconType="Graph" IconColor="Brown"> </Attachment> <Attachment AttachmentType="Note" IsNoteOpen="true" NoteContent="This is a note."> </Attachment> </Section> </Pdf>


Nested Class Summary
 
Nested classes/interfaces inherited from class aspose.pdf.Paragraph
Paragraph.VerticalPositionInfo
 
Field Summary
 
Fields inherited from class aspose.pdf.Paragraph
_realPageNumber, INNER_INDENT, isNeedAddToPage, isPositionProcessed, VerticalPosInfo
 
Constructor Summary
Attachment()
          Constructor - initializes a new instance of the Attachment class.
 
Method Summary
 java.lang.Object completeClone()
          Clones a new Attachment.
 java.lang.String getAttachedFileName()
          Gets a string that indicates the attach file name.
 java.lang.String getAttachedFileType()
          Gets a string that indicates the MIME type of the attached file.
 BinaryFileStream getAttachedStream()
          Gets a stream attached to the file.
 AttachmentType getAttachmentType()
          Gets an AttachmentType object that indicates the attachment type.
 FileIconType getFileIconType()
          Gets a FileIconType object that indicates the file attachment icon type.
 Color getIconColor()
          Gets a Color object that indicates the color of the icon.
 boolean getIsNoteOpen()
          Gets a boolean value that indicates whether the note is open or not when the Pdf document is opened.
 java.lang.String getNoteContent()
          Gets a string that indicates the content of the attached note.
 java.lang.String getNoteHeading()
          Gets a string that indicates the heading (title) of the attached note.
 NoteIconType getNoteIconType()
          Gets a NoteIconType object that indicates the note icon type.
 RectangleArea getNoteWindowPosition()
          Gets a RectangleArea object that indicates the position of the note's popup window.
 NoteWindowPositioningType getNoteWindowPositioningType()
          Gets a NoteWindowPositioningType object that indicates the note window's positioning type.
 void setAttachedFileName(java.lang.String value)
          Sets a string that indicates the attach file name.
 void setAttachedFileType(java.lang.String value)
          Sets a string that indicates the MIME type of the attached file.
 void setAttachedStream(BinaryFileStream value)
          Sets a stream attaches to the file.
 void setAttachmentType(AttachmentType value)
          Sets a AttachmentType that indicates the attachment type.
 void setFileIconType(FileIconType value)
          Sets a FileIconType object that indicates the file attachment icon type.
 void setIconColor(Color value)
          Sets a Color object that indicates the color of the icon.
 void setIsNoteOpen(boolean value)
          Sets a boolean value that indicates whether the note is open or not when the Pdf document is opened.
 void setNoteContent(java.lang.String value)
          Sets a string that indicates the content of the attached note.
 void setNoteHeading(java.lang.String value)
          Sets a string that indicates the heading (title) of the attached note.
 void setNoteIconType(NoteIconType value)
          Sets a NoteIconType that indicates the note icon type.
 void setNoteWindowPosition(RectangleArea value)
          Sets a RectangleArea object that indicates the position of the note's popup window.
 void setNoteWindowPositioningType(NoteWindowPositioningType value)
          Sets a NoteWindowPositioningType object that indicates the note window's positioning type.
 
Methods inherited from class aspose.pdf.Paragraph
copyTo, getHeight, getID, getIsNeedAddToPage, getIsPositionGot, getIsPositionProcessed, getLeft, getMargin, getMayNeedReprocess, getNeedReprocess, getNextParagraphInHeading, getPageNumber, getParentCell, getPositioningType, getPosX, getPosY, getRealPageNumber, getReferenceParagraphID, getRefPara, getSection, getTop, getVerticalPosInfo, getWidth, isDisabled, isEndNote, isFirstParagraph, isFirstParagraphInColumn, isFootNote, isFootNoteProcessed, isInHeaderFooter, isInList, isKeptTogether, isKeptWithNext, isOnOddPage, setEndNote, setFootNoteProcessed, setHeight, setID, setIsDisabled, setIsFirstParagraph, setIsFirstParagraphInColumn, setIsFootNote, setIsInHeaderFooter, setIsInList, setIsKeptTogether, setIsKeptWithNext, setIsNeedAddToPage, setIsOnOddPage, setIsPositionGot, setIsPositionProcessed, setLeft, setMargin, setMayNeedReprocess, setNeedReprocess, setNextParagraphInHeading, setPageNumber, setParentCell, setParentIsTable, setPositioningType, setPosX, setPosY, setRealPageNumber, setReferenceParagraphID, setRefPara, setSection, setTop, setVerticalPosInfo, setWidth
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Attachment

public Attachment()
Constructor - initializes a new instance of the Attachment class.

Method Detail

getAttachmentType

public AttachmentType getAttachmentType()
Gets an AttachmentType object that indicates the attachment type.

Returns:
An AttachmentType object.

setAttachmentType

public void setAttachmentType(AttachmentType value)
Sets a AttachmentType that indicates the attachment type.

Parameters:
value - An AttachmentType object.

getAttachedFileName

public java.lang.String getAttachedFileName()
Gets a string that indicates the attach file name.

Returns:
A String value.

setAttachedFileName

public void setAttachedFileName(java.lang.String value)
Sets a string that indicates the attach file name.

Parameters:
value - A String value.

getAttachedStream

public BinaryFileStream getAttachedStream()
Gets a stream attached to the file.

Returns:
A BinaryFileStream object.

setAttachedStream

public void setAttachedStream(BinaryFileStream value)
Sets a stream attaches to the file.

Parameters:
value - A BinaryFileStream object.

getAttachedFileType

public java.lang.String getAttachedFileType()
Gets a string that indicates the MIME type of the attached file.

Returns:
A String value.

setAttachedFileType

public void setAttachedFileType(java.lang.String value)
Sets a string that indicates the MIME type of the attached file.

Parameters:
value - A String value.

getFileIconType

public FileIconType getFileIconType()
Gets a FileIconType object that indicates the file attachment icon type.

Returns:
A FileIconType object.

setFileIconType

public void setFileIconType(FileIconType value)
Sets a FileIconType object that indicates the file attachment icon type.

Parameters:
value - A FileIconType object.

getNoteWindowPositioningType

public NoteWindowPositioningType getNoteWindowPositioningType()
Gets a NoteWindowPositioningType object that indicates the note window's positioning type. Default is Auto.

Returns:
A NoteWindowPositioningType object.

setNoteWindowPositioningType

public void setNoteWindowPositioningType(NoteWindowPositioningType value)
Sets a NoteWindowPositioningType object that indicates the note window's positioning type. Default is Auto.

Parameters:
value - A NoteWindowPositioningType object.

getNoteWindowPosition

public RectangleArea getNoteWindowPosition()
Gets a RectangleArea object that indicates the position of the note's popup window.

Returns:
A RectangleArea object.

setNoteWindowPosition

public void setNoteWindowPosition(RectangleArea value)
Sets a RectangleArea object that indicates the position of the note's popup window.

Parameters:
value - A RectangleArea object.

getNoteContent

public java.lang.String getNoteContent()
Gets a string that indicates the content of the attached note.

Returns:
A String value.

setNoteContent

public void setNoteContent(java.lang.String value)
Sets a string that indicates the content of the attached note.

Parameters:
value - A String value.

getNoteHeading

public java.lang.String getNoteHeading()
Gets a string that indicates the heading (title) of the attached note.

Returns:
A String value.

setNoteHeading

public void setNoteHeading(java.lang.String value)
Sets a string that indicates the heading (title) of the attached note.

Parameters:
value - A String value.

getNoteIconType

public NoteIconType getNoteIconType()
Gets a NoteIconType object that indicates the note icon type.

Returns:
A NoteIconType object.

setNoteIconType

public void setNoteIconType(NoteIconType value)
Sets a NoteIconType that indicates the note icon type.

Parameters:
value - A NoteIconType object.

getIsNoteOpen

public boolean getIsNoteOpen()
Gets a boolean value that indicates whether the note is open or not when the Pdf document is opened.

Returns:
A boolean value.

setIsNoteOpen

public void setIsNoteOpen(boolean value)
Sets a boolean value that indicates whether the note is open or not when the Pdf document is opened.

Parameters:
value - A boolean value.

getIconColor

public Color getIconColor()
Gets a Color object that indicates the color of the icon.

Returns:
A Color object.

setIconColor

public void setIconColor(Color value)
Sets a Color object that indicates the color of the icon.

Parameters:
value - A Color object.

completeClone

public java.lang.Object completeClone()

Clones a new Attachment.

Specified by:
completeClone in class Paragraph
Returns:
The new Attachment object.