SetaPDF_Core_Document_Page_Annotation_FreeText Class representing a free text annotation
File: /SetaPDF v2/Core/Document/Page/Annotation/FreeText.php
See PDF 32000-1:2008 - 12.5.6.6
Class hierarchy
Summary
Methods
- __construct()
- _getReplies()
- addReply()
- cleanUp()
- createPopup()
- getAdditionalActions()
- getAlign()
- getAnnotationDictionary()
- getAppearance()
- getBorderEffect()
- getBorderStyle()
- getCalloutLine()
- getColor()
- getContents()
- getCreationDate()
- getDictionary()
- getDifferencesRect()
- getHeight()
- getHiddenFlag()
- getInReplyTo()
- getIndirectObject()
- getIntent()
- getInvisibleFlag()
- getLineEndingStyle()
- getLockedContents()
- getLockedFlag()
- getModificationDate()
- getName()
- getNoRotateFlag()
- getNoViewFlag()
- getNoZoomFlag()
- getOpacity()
- getPopup()
- getPrintFlag()
- getReadOnlyFlag()
- getRect()
- getReplies()
- getSubject()
- getTextLabel()
- getToggleNoView()
- getType()
- getWidth()
- hasReplies()
- isAnnotationFlagSet()
- isReplyTo()
- setAlign()
- setAnnotationFlags()
- setAppearance()
- setCalloutLine()
- setColor()
- setContents()
- setCreationDate()
- setDifferencesRect()
- setHiddenFlag()
- setInReplyTo()
- setIntent()
- setInvisibleFlag()
- setLineEndingStyle()
- setLocked()
- setLockedContents()
- setModificationDate()
- setName()
- setNoRotateFlag()
- setNoViewFlag()
- setNoZoomFlag()
- setOpacity()
- setPopup()
- setPrintFlag()
- setReadOnlyFlag()
- setRect()
- setSubject()
- setTextLabel()
- setToggleNoView()
- unsetAnnotationFlags()
Constants
- INTENT_FREE_TEXT
- INTENT_FREE_TEXT_CALLOUT
- INTENT_FREE_TEXT_TYPE_WRITER
- TYPE_3D
- TYPE_CARET
- TYPE_CIRCLE
- TYPE_FILE_ATTACHMENT
- TYPE_FREE_TEXT
- TYPE_HIGHLIGHT
- TYPE_INK
- TYPE_LINE
- TYPE_LINK
- TYPE_MOVIE
- TYPE_POLYGON
- TYPE_POLY_LINE
- TYPE_POPUP
- TYPE_PRINTER_MARK
- TYPE_REDACT
- TYPE_SCREEN
- TYPE_SOUND
- TYPE_SQUARE
- TYPE_SQUIGGLY
- TYPE_STAMP
- TYPE_STRIKE_OUT
- TYPE_TEXT
- TYPE_TRAP_NET
- TYPE_UNDERLINE
- TYPE_WATERMARK
- TYPE_WIDGET
Constants
INTENT_FREE_TEXT
Intent constant
INTENT_FREE_TEXT_CALLOUT
Intent constant
INTENT_FREE_TEXT_TYPE_WRITER
Intent constant
TYPE_3D
Annotation type
TYPE_CARET
Annotation type
TYPE_CIRCLE
Annotation type
TYPE_FILE_ATTACHMENT
Annotation type
TYPE_FREE_TEXT
Annotation type
TYPE_HIGHLIGHT
Annotation type
TYPE_INK
Annotation type
TYPE_LINE
Annotation type
TYPE_LINK
Annotation type
TYPE_MOVIE
Annotation type
TYPE_POLYGON
Annotation type
TYPE_POLY_LINE
Annotation type
TYPE_POPUP
Annotation type
TYPE_PRINTER_MARK
Annotation type
TYPE_REDACT
Annotation type
TYPE_SCREEN
Annotation type
TYPE_SOUND
Annotation type
TYPE_SQUARE
Annotation type
TYPE_SQUIGGLY
Annotation type
TYPE_STAMP
Annotation type
TYPE_STRIKE_OUT
Annotation type
TYPE_TEXT
Annotation type
TYPE_TRAP_NET
Annotation type
TYPE_UNDERLINE
Annotation type
TYPE_WATERMARK
Annotation type
TYPE_WIDGET
Annotation type
Properties
$_annotationDictionary
The annotation dictionary
Static Methods
_createAnnotationDictionary()
Creates an annotation dictionary with default values.
Parameters
- $rect : SetaPDF_Core_DataStructure_Rectangle|array
- $subtype : string
byObjectOrDictionary()
Creates an annotation object by an annotation dictionary or its parent object.
Parameters
- $objectOrDictionary : SetaPDF_Core_Type_Dictionary|SetaPDF_Core_Type_IndirectObjectInterface
Exceptions
Throws SetaPDF_Core_Type_Exception
Throws InvalidArgumentException
createAnnotationDictionary()
Creates an annotation dictionary.
Parameters
- $rect : SetaPDF_Core_DataStructure_Rectangle|array
- $fontName : string
The font name, which is registered in the AcroForm DR dictionary.
- $fontSize : int|float
The font size
- $color : int|float|string|array|SetaPDF_Core_Type_Array|SetaPDF_Core_DataStructure_Color
See
SetaPDF_Core_DataStructure_Color::createByComponents()
for more details.
Exceptions
Throws InvalidArgumentException
Methods
__construct()
The constructor.
If the parameter cannot be resolved as a dictionary all parameters were passed to the self::createAnnotationDictionary() method.
Parameters
- $objectOrDictionary : array|SetaPDF_Core_Type_AbstractType|SetaPDF_Core_Type_Dictionary|SetaPDF_Core_Type_IndirectObjectInterface
Exceptions
Throws InvalidArgumentException
Throws SetaPDF_Core_Type_Exception
_getReplies()
Get all replies or checks for their existance.
Parameters
- $annotations : SetaPDF_Core_Document_Page_Annotations
- $onlyCheckForExistance : bool
Exceptions
Throws SetaPDF_Core_Type_Exception
addReply()
Adds a reply to this annotation.
Parameters
- $annotation : SetaPDF_Core_Document_Page_Annotation_Markup
createPopup()
Create a popup annotation object for this annotation.
If the x-offset value is less than zero the popup will be created at the left side of the main annotation. Otherwise on the right side. If the y-offset value is less than zero the popup will be create down below the main annotation. Otherwise above.
You need to re-add this new popup annotation to its origin annotation by passing it to
the addPopup()
method after
assigning it to the page object.
Parameters
- $offsetX : int|float
- $offsetY : int|float
- $width : int|float
- $height : int|float
Exceptions
Throws SetaPDF_Core_Type_Exception
getAdditionalActions()
Gets the additional actions object instance for this annotation.
getAlign()
Get the form of quadding (justification / align) that shall be used in displaying the annotation’s text.
Exceptions
Throws SetaPDF_Core_Type_Exception
getAnnotationDictionary()
WARNING: This method is marked as deprecated!
Get the annotation dictionary.
getAppearance()
Get the annotation appearance stream.
Parameters
- $type : string
- $subName : null|string
Exceptions
Throws InvalidArgumentException
getBorderEffect()
Get the border effect object.
Parameters
- $create : bool
getBorderStyle()
Get the border style object.
getCalloutLine()
Get the array of four or six numbers specifying a callout line attached to the free text annotation.
getColor()
Get the color of the annotation.
getContents()
Get the contents of the annotation.
Parameters
- $encoding : string
getCreationDate()
Get the creation date.
The date and time when the annotation was created.Parameters
- $asString : bool
Whether receive the value as a string (PDF date string) or as a
SetaPDF_Core_DataStructure_Date
instance.
Exceptions
Throws Exception
See
- PDF 32000-1:2008 - 12.5.6.2 - Table 170
- SetaPDF_Core_Document_Page_Annotation_Markup::setCreationDate()
getDifferencesRect()
Get the rectangle describing the difference between the Rect entry and the inner text rectangle.
getHeight()
getHiddenFlag()
Checks for the "Hidden" flag.
PDF 32000-1:2008 - Table 165: "If set, do not display or print the annotation or allow it to interact with the user, regardless of its annotation type or whether an annotation handler is available."
getInReplyTo()
Get the in reply to annotation (if available).
Exceptions
Throws SetaPDF_Core_Type_Exception
See
- SetaPDF_Core_Document_Page_Annotation_Markup::setInReplyTo()
- PDF 32000-1:2008 - 12.5.6.2 - Table 170
getIndirectObject()
Get the indirect object of this annotation.
Parameters
- $document : SetaPDF_Core_Document
getInvisibleFlag()
Checks for the "Invisible" flag.
PDF 32000-1:2008 - Table 165: "If set, do not display the annotation if it does not belong to one of the standard annotation types and no annotation handler is available. If clear, display such an unknown annotation using an appearance stream specified by its appearance dictionary, if any"
getLockedContents()
Checks for the "LockedContents" flag.
PDF 32000-1:2008 - Table 165: "If set, do not allow the contents of the annotation to be modified by the user. This flag does not restrict deletion of the annotation or changes to other annotation properties, such as position and size."
getLockedFlag()
Checks the "Locked" flag.
PDF 32000-1:2008 - Table 165: "If set, do not allow the annotation to be deleted or its properties (including position and size) to be modified by the user. However, this flag does not restrict changes to the annotation’s contents, such as the value of a form field."
getModificationDate()
Get the modification date.
Parameters
- $asString : bool
Exceptions
Throws Exception
getName()
Get the name of the annotation.
Parameters
- $encoding : string
getNoRotateFlag()
Checks fo the "NoRotate" flag.
PDF 32000-1:2008 - Table 165: "If set, do not rotate the annotation’s appearance to match the rotation of the page. The upper-left corner of the annotation rectangle shall remain in a fixed location on the page, regardless of the page rotation."
getNoViewFlag()
Checks for the "NoView" flag.
PDF 32000-1:2008 - Table 165: "If set, do not display the annotation on the screen or allow it to interact with the user. The annotation may be printed (depending on the setting of the Print flag) but should be considered hidden for purposes of on-screen display and user interaction."
getNoZoomFlag()
Checks fo the "NoZoom" flag.
PDF 32000-1:2008 - Table 165: "If set, do not scale the annotation’s appearance to match the magnification of the page. The location of the annotation on the page (defined by the upper- left corner of its annotation rectangle) shall remain fixed, regardless of the page magnification."
getPopup()
Get the associated popup object if available.
Exceptions
Throws SetaPDF_Core_Type_Exception
getPrintFlag()
Checks for the "Print" flag.
PDF 32000-1:2008 - Table 165: "If set, print the annotation when the page is printed. If clear, never print the annotation, regardless of whether it is displayed on the screen."
getReadOnlyFlag()
Checks the "ReadOnly" flag.
PDF 32000-1:2008 - Table 165: "If set, do not allow the annotation to interact with the user. The annotation may be displayed or printed (depending on the settings of the NoView and Print flags) but should not respond to mouse clicks or change its appearance in response to mouse motions.
This flag shall be ignored for widget annotations; its function is subsumed by the ReadOnly flag of the associated form field"
getRect()
Get the rectangle object of this annotation.
getReplies()
Get all annotations which refer this annotation as an reply.
Parameters
- $annotations : SetaPDF_Core_Document_Page_Annotations
Exceptions
Throws SetaPDF_Core_Type_Exception
getSubject()
Get the subject.
Text representing a short description of the subject being addressed by the annotation.Parameters
- $encoding : string
See
- SetaPDF_Core_Document_Page_Annotation_Markup::setSubject()
- PDF 32000-1:2008 - 12.5.6.2 - Table 170
getTextLabel()
Get the text label.
The text label that shall be displayed in the title bar of the annotation’s pop-up window when open and active. This entry shall identify the user who added the annotation.Parameters
- $encoding : string
See
- SetaPDF_Core_Document_Page_Annotation_Markup::setTextLabel()
- PDF 32000-1:2008 - 12.5.6.2 - Table 170
getToggleNoView()
Checks for the "ToggleNoView" flag.
PDF 32000-1:2008 - Table 165: "If set, invert the interpretation of the NoView flag for certain events."
getWidth()
hasReplies()
Check whether this annotation has a reply or not.
Parameters
- $annotations : SetaPDF_Core_Document_Page_Annotations
Exceptions
Throws SetaPDF_Core_Type_Exception
setAlign()
Set the form of quadding (justification / align) that shall be used in displaying the annotation’s text.
Parameters
- $align : string
See
setAnnotationFlags()
Sets an annotation flag.
Parameters
- $flags : integer
- $set : boolean
Set or unset
setAppearance()
Set the annotation appearance stream.
Parameters
- $xObject : SetaPDF_Core_XObject_Form
- $type : string
- $subState : string|null
setCalloutLine()
Set the array of four or six numbers specifying a callout line attached to the free text annotation.
1 2 <---\ \ \ 3
Parameters
- $x1OrPoints : array<int|float>|false
- $y1 : null|int|float
- $x2 : null|int|float
- $y2 : null|int|float
- $x3 : null|int|float
- $y3 : null|int|float
setColor()
Set the color of the annotation.
Parameters
- $color : null|bool|int|float|string|array|SetaPDF_Core_DataStructure_Color
setContents()
Set the contents of the annotation.
Parameters
- $contents : string|null
- $encoding : string
setCreationDate()
Set the creation date.
Parameters
- $date : null|bool|string|DateTime|SetaPDF_Core_Type_String|SetaPDF_Core_DataStructure_Date
Exceptions
Throws Exception
See
- PDF 32000-1:2008 - 12.5.6.2 - Table 170
- SetaPDF_Core_Document_Page_Annotation_Markup::getCreationDate()
setDifferencesRect()
Set the rectangle describing the difference between the Rect entry and the inner text rectangle.
PDF 32000-1:2008 - Table 174
The four numbers correspond to the differences in default user space between the left, top, right, and bottom coordinates of Rect and those of the inner rectangle, respectively. Each value shall be greater than or equal to 0. The sum of the top and bottom differences shall be less than the height of Rect, and the sum of the left and right differences shall be less than the width of Rect.Parameters
- $differencesRect : SetaPDF_Core_DataStructure_Rectangle
setInReplyTo()
Set the in reply to annotation object.
Parameters
- $annotation : SetaPDF_Core_Document_Page_Annotation_Markup
Exceptions
Throws InvalidArgumentException
See
- SetaPDF_Core_Document_Page_Annotation_Markup::getInReplyTo()
- PDF 32000-1:2008 - 12.5.6.2 - Table 170
setIntent()
Set the name describing the intent of the free text annotation.
Parameters
- $intent : string
setInvisibleFlag()
Set the "Invisible" flag.
Parameters
- $invisible : boolean
See
setLineEndingStyle()
Set the line ending styles.
Parameters
- $lineEndingStyle : string
See
setLockedContents()
Set the "LockedContents" flag.
Parameters
- $lockedContents : boolean
See
setModificationDate()
Set the modification date.
Parameters
- $date : SetaPDF_Core_DataStructure_Date|DateTime|string|bool
If true is passed, the current date and time will be used.
Exceptions
Throws Exception
setName()
Set the name of the annotation.
The annotation name, a text string uniquely identifying it among all the annotations on its page.
Parameters
- $name : string|null
- $encoding : string
setNoRotateFlag()
Set the "NoRotate" flag.
Parameters
- $noRotate : boolean
See
setPopup()
Set the pop-up annotation object.
Parameters
- $annotation : SetaPDF_Core_Document_Page_Annotation_Popup
Exceptions
Throws InvalidArgumentException
setReadOnlyFlag()
Set the "ReadOnly" flag.
Parameters
- $readOnly : boolean
See
setRect()
setSubject()
Get the subject.
Parameters
- $subject : string|null
- $encoding : string
See
- SetaPDF_Core_Document_Page_Annotation_Markup::getSubject()
- PDF 32000-1:2008 - 12.5.6.2 - Table 170
setTextLabel()
Set the text label.
Parameters
- $textLabel : string|null
- $encoding : string
See
- SetaPDF_Core_Document_Page_Annotation_Markup::getTextLabel()
- PDF 32000-1:2008 - 12.5.6.2 - Table 170
setToggleNoView()
Set the "ToggleNoView" flag.
Parameters
- $toggleNoView : boolean