-
new Mark(parameters)
-
NOTE: this constructor is for internal use only.
To programmatically add a Mark (an annotation or redaction) to a document, use PCCViewer.ViewerControl#addMark.
Parameters:
Name Type Description parametersObject The parameters object takes the following properties:
type{string} [required] Mark Type PCCViewer.Mark.TypepageNumber{number} [optional] Page Number on which the Mark is located . If this property is not specified, the page number will default to the current page.
Example
var viewerControl = new PCCViewer.ViewerControl(...); // use PCCViewer.ViewerControl#addMark(pageNumer, markType) to create // and add a mark instead of new Mark() viewerControl.addMark(1, "LineAnnotation");
Members
-
<static, readonly> FontStyles :string
-
The
PCCViewer.Mark.FontStylesenumeration defines Font Styles known to the ViewerControl.Note: This enumeration is for convenience for API developers. Instead of using this enumeration, you may pass string values of the
FontStyles(enumeration values).Type:
- string
-
Properties:
-
Name Type Default Description Boldstring Bold Specifies that the text should be bold.
Italicstring Italic Specifies that the text should be italic.
Strikeoutstring Strikeout Specifies that the text should be struck out.
Underlinestring Underline Specifies that the text should be underlined.
-
- See:
Example
// use the enumeration to make text Bold mark.setFontStyle([PCCViewer.Mark.FontStyles.Bold]); // or just use the string value. Note: The parameter should be an array of styles required. mark.setFontStyle(["Bold"]); -
<static, readonly> HorizontalAlignment :string
-
The
PCCViewer.Mark.HorizontalAlignmentenumeration defines horizontal alignment known to the ViewerControl.Note: This enumeration is for convenience for API developers. Instead of using this enumeration, you may pass string values of the
HorizontalAlignment(enumeration values).Type:
- string
-
Properties:
-
Name Type Default Description Centerstring Center Specifies that the text should be centered horizontally.
Leftstring Left Specifies that the text should be left-justified.
Rightstring Right Specifies that the text should be right-justified.
-
Example
// use the enumeration to make text centered mark.setHorizontalAlignment(PCCViewer.Mark.HorizontalAlignment.Center); // or just use the string value mark.setHorizontalAlignment("Center"); -
<static, readonly> LineHeadType :string
-
The
PCCViewer.Mark.LineHeadTypeenumeration defines MarkLineHeadTypesknown to the ViewerControl.Note: This enumeration is for convenience for API developers. Instead of using this enumeration, you may pass string values of the
LineHeadType(enumeration values).Type:
- string
-
Properties:
-
Name Type Default Description Nonestring None No line head.
FilledTrianglestring FilledTriangle A filled triangle line head. Note: this makes the line an arrow. :)
-
Example
// use the enumeration to make a line an arrow myLineAnnotation.setEndHeadType(PCCViewer.Mark.LineHeadType.FilledTriangle); // or just use the string value myLineAnnotation.setEndHeadType("FilledTriangle"); -
<static, readonly> Type :string
-
The
PCCViewer.Mark.Typeenumeration defines Mark Types known to the ViewerControl.Note: This enumeration is for convenience for API developers. Instead of using this enumeration, you may pass string values of the
Type(enumeration values).Type:
- string
-
Properties:
-
Name Type Default Description LineAnnotationstring LineAnnotation This mark is drawn as a line on the document. A head can be added to the end of the line to make the line an arrow.
The properties specific for this are:
color,thickness,opacity,startPoint,endPoint,endHeadType.RectangleAnnotationstring RectangleAnnotation This mark is drawn as a rectangle on the document.
The properties specific for this are:
fillColor,opacity,borderColor,borderThickness,rectangle.EllipseAnnotationstring EllipseAnnotation This mark is drawn as an ellipse on the document.
The properties specific for this are:
fillColor,opacity,borderColor,borderThickness,rectangle.TextAnnotationstring TextAnnotation This mark is drawn as text on the document. The text has a background and border.
The properties specific for this are:
text,fontColor,fillColor,opacity,borderColor,borderThickness,fontName,fontSize,fontStyle,horizontalAlignment,rectangle.StampAnnotationstring StampAnnotation This mark is drawn as a stamp on the document. A stamp has a label (text) and a border.
The properties specific for this are:
color,label,rectangle.HighlightAnnotationstring HighlightAnnotation This mark is drawn as a text highlight on the document.
The properties specific for this are:
fillColor.RectangleRedactionstring RectangleRedaction This mark is drawn as a rectangle on the document.
The properties specific for this are:
rectangle.TransparentRectangleRedactionstring TransparentRectangleRedaction This mark is drawn as a transparent rectangle on the document. The color is always yellow and the opacity is always 50% (127/255).
The properties specific for this are:
rectangle.TextRedactionstring TextRedaction This mark is drawn as a rectangle on the document. This redaction can be burned into the document.
The properties specific for this are:
text,fontColor,fontName,fontSize,fontStyle,rectangle.StampRedactionstring StampRedaction This mark is drawn as a stamp on the document. This redaction can be burned into the document.
The properties specific for this are:
label,rectangle.
-
Example
// use the enumeration to make a line annotation myViewerControl.addMark(1, PCCViewer.Mark.Type.LineAnnotation); // or just use the string value myViewerControl.addMark(1, "LineAnnotation"); -
borderColor :string
-
Gets or sets the border color of the Mark.
This property is defined on marks of type:
RectangleRedaction,EllipseAnnotation,TextAnnotation.This is an ECMA 5 accessor property that is defined only in browsers supporting ECMA 5. This property is not available in the older browsers like IE8. For the greatest browser compatibility, use the corresponding getter and setter methods.
Type:
- string
Example
if ('borderColor' in mark) { var oldValue = mark.borderColor; mark.borderColor = "#FF0000"; // set border color to red } -
borderThickness :number
-
Gets or sets the border thickness of the Mark.
This property is defined on marks of type:
RectangleAnnotation,EllipseAnnotation,TextAnnotation.This is an ECMA 5 accessor property that is defined only in browsers supporting ECMA 5. This property is not available in the older browsers like IE8. For the greatest browser compatibility, use the corresponding getter and setter methods.
Type:
- number
Example
if ('borderThickness' in mark) { var oldValue = mark.borderThickness; mark.borderThickness = 3; // set the border thickness of the mark } -
color :string
-
Gets or sets the color of the Mark.
This property is defined on marks of type:
LineAnnotation,StampAnnotation.This is an ECMA 5 accessor property that is defined only in browsers supporting ECMA 5. This property is not available in the older browsers like IE8. For the greatest browser compatibility, use the corresponding getter and setter methods.
Type:
- string
Example
if ('color' in mark) { var oldValue = mark.color; mark.color = "#FF0000"; // set color to red } -
endHeadType :string
-
Gets or sets the end head type of the Mark.
The value of end head type determines if the line looks like an arrow or a plain line.
This property is defined on marks of type:
LineAnnotation.This is an ECMA 5 accessor property that is defined only in browsers supporting ECMA 5. This property is not available in the older browsers like IE8. For the greatest browser compatibility, use the corresponding getter and setter methods.
Type:
- string
Example
if ('endHeadType' in mark) { var oldValue = mark.endHeadType; // set the head to be a filled triangle, so the line looks like an arrow mark.endHeadType = "FilledTriangle"; } -
endPoint :Object
-
Gets or sets the end point coordinates of the line Mark.
This property is defined on marks of type:
LineAnnotation.This is an ECMA 5 accessor property that is defined only in browsers supporting ECMA 5. This property is not available in the older browsers like IE8. For the greatest browser compatibility, use the corresponding getter and setter methods.
Type:
- Object
Example
if ('endPoint' in mark) { var oldValue = mark.endPoint; mark.endPoint = {x: 100, y: 100}; // set the start point to (100, 100) } -
fillColor :string
-
Gets or sets the fill color of the Mark.
This property is defined on marks of type:
RectangleAnnotation,EllipseAnnotation,TextAnnotation.This is an ECMA 5 accessor property that is defined only in browsers supporting ECMA 5. This property is not available in the older browsers like IE8. For the greatest browser compatibility, use the corresponding getter and setter methods.
Type:
- string
Example
if ('fillColor' in mark) { var oldValue = mark.fillColor; mark.fillColor = "#FF0000"; // set color to red } -
fontColor :string
-
Gets or sets the font color of the text in the Text Mark.
This property is defined on marks of type:
TextRedaction,TextRedaction.This is an ECMA 5 accessor property that is defined only in browsers supporting ECMA 5. This property is not available in the older browsers like IE8. For the greatest browser compatibility, use the corresponding getter and setter methods.
Type:
- string
Example
if ('fontColor' in mark) { var oldValue = mark.fontColor; mark.fontColor = "#ffccbb"; } -
fontName :string
-
Gets or sets the font name of the text in the Text Mark.
This property is defined on marks of type:
TextRedaction,TextRedaction.This is an ECMA 5 accessor property that is defined only in browsers supporting ECMA 5. This property is not available in the older browsers like IE8. For the greatest browser compatibility, use the corresponding getter and setter methods.
Type:
- string
Example
if ('fontName' in mark) { var oldValue = mark.fontName; mark.fontName = "Aerial"; } -
fontSize :number
-
Gets or sets the font size (in points) for the text in the Text Mark.
This property is defined on marks of type:
TextAnnotation,TextRedaction.This is an ECMA 5 accessor property that is defined only in browsers supporting ECMA 5. This property is not available in the older browsers like IE8. For the greatest browser compatibility, use the corresponding getter and setter methods.
Type:
- number
Example
if ('fontSize' in mark) { var oldValue = mark.fontSize; mark.fontSize = 12; } -
fontStyle :Array.<string>
-
Gets or sets the font Style of the text in the TextAnnotation mark.
This property is defined on marks of type:
TextRedaction.This is an ECMA 5 accessor property that is defined only in browsers supporting ECMA 5. This property is not available in the older browsers like IE8. For the greatest browser compatibility, use the corresponding getter and setter methods.
Type:
- Array.<string>
Example
if ('fontStyle' in mark) { var oldValue = mark.fontStyle; mark.fontStyle = ["Bold",Underline,Italic]; } -
horizontalAlignment :string
-
Gets or sets the text horizontal alignment of the text in the Text Mark.
This property is defined on marks of type:
TextAnnotation.This is an ECMA 5 accessor property that is defined only in browsers supporting ECMA 5. This property is not available in the older browsers like IE8. For the greatest browser compatibility, use the corresponding getter and setter methods.
Type:
- string
- See:
Example
if ('horizontalAlignment' in mark) { var oldValue = mark.horizontalAlignment; mark.horizontalAlignment = "left"; } -
<readonly> id :string
-
Gets the ID of the Mark.
This property is defined on all Mark objects.
This is an ECMA 5 accessor property that is defined only in browsers supporting ECMA 5. This property is not available in the older browsers like IE8. For the greatest browser compatibility, use the corresponding getter and setter methods.
Type:
- string
- See:
Example
var id = mark.id; -
label :string
-
Gets or sets the text in the Stamp Mark.
This property is defined on marks of type:
StampAnnotation,StampRedaction.This is an ECMA 5 accessor property that is defined only in browsers supporting ECMA 5. This property is not available in the older browsers like IE8. For the greatest browser compatibility, use the corresponding getter and setter methods.
Type:
- string
- See:
-
- PCCViewer.Mark#geLabel
- PCCViewer.Mark#setLabel
Example
if ('label' in mark) { var oldValue = mark.label; mark.label = "Approved"; } -
opacity :number
-
Gets or sets the opacity of the Mark. This value is a number between 0 and 255.
This property is defined on marks of type:
LineAnnotation,RectangleAnnotation,EllipseAnnotation,TextAnnotation.This is an ECMA 5 accessor property that is defined only in browsers supporting ECMA 5. This property is not available in the older browsers like IE8. For the greatest browser compatibility, use the corresponding getter and setter methods.
Type:
- number
Example
if ('opacity' in mark) { var oldValue = mark.opacity; mark.opacity = 127; // set the opacity so that the mark is transparent } -
<readonly> pageNumber :number
-
Gets the page number of the page that the Mark is on.
This property is defined on all Mark objects.
This is an ECMA 5 accessor property that is defined only in browsers supporting ECMA 5. This property is not available in the older browsers like IE8. For the greatest browser compatibility, use the corresponding getter and setter methods.
Type:
- number
Example
var pageNumber = mark.pageNumber; -
rectangle :Object
-
Gets or sets the bounding rectangle of the Mark.
This property is defined on marks of type:
RectangleAnnotation,EllipseAnnotation,TextAnnotation,StampAnnotation,RectangleRedaction,TextRedaction,StampRedaction.This is an ECMA 5 accessor property that is defined only in browsers supporting ECMA 5. This property is not available in the older browsers like IE8. For the greatest browser compatibility, use the corresponding getter and setter methods.
Type:
- Object
Example
if ('rectangle' in mark) { var oldValue = mark.rectangle; mark.rectangle = {x: 0, y: 0, width: 100, height: 100}; } -
startPoint :Object
-
Gets or sets the start point coordinates of the line Mark.
This property is defined on marks of type:
LineAnnotation.This is an ECMA 5 accessor property that is defined only in browsers supporting ECMA 5. This property is not available in the older browsers like IE8. For the greatest browser compatibility, use the corresponding getter and setter methods.
Type:
- Object
Example
if ('startPoint' in mark) { var oldValue = mark.startPoint; mark.startPoint = {x: 1, y: 1}; // set the start point to (1, 1) } -
text :string
-
Gets or sets the text in the Mark.
This property is defined on marks of type:
TextAnnotation,TextRedaction.This is an ECMA 5 accessor property that is defined only in browsers supporting ECMA 5. This property is not available in the older browsers like IE8. For the greatest browser compatibility, use the corresponding getter and setter methods.
Type:
- string
Example
if ('text' in mark) { var oldValue = mark.text; mark.text = "This is a Test"; } -
thickness :number
-
Gets or sets the thickness of the Mark.
This property is defined on marks of type:
LineAnnotation.This is an ECMA 5 accessor property that is defined only in browsers supporting ECMA 5. This property is not available in the older browsers like IE8. For the greatest browser compatibility, use the corresponding getter and setter methods.
Type:
- number
Example
if ('thickness' in mark) { var oldValue = mark.thickness; mark.thickness = 3; // set the thickness of the mark } -
<readonly> type :string
-
Gets the type of the Mark.
This property is defined on all Mark objects.
This is an ECMA 5 accessor property that is defined only in browsers supporting ECMA 5. This property is not available in the older browsers like IE8. For the greatest browser compatibility, use the corresponding getter and setter methods.
Type:
- string
Example
switch (mark.type) { case PCCViewer.Mark.Type.LineAnnotation: ... break; default: ... }
Methods
-
getBorderColor() → {string}
-
Gets the border color of the Mark.
This property is defined on marks of type:
RectangleRedaction,EllipseAnnotation,TextAnnotation.Returns:
The border color of the Mark as a hexadecimal string.
- Type
- string
Example
if (mark.getBorderColor) { var borderColor = mark.getBorderColor(); } -
getBorderThickness() → {number}
-
Gets the border thickness of the mark.
This property is defined on marks of type:
RectangleAnnotation,EllipseAnnotation,TextAnnotation.Returns:
The border thickness of the mark.
- Type
- number
Example
if (mark.getBorderThickness) { var borderThickness = mark.getBorderThickness(); } -
getColor() → {string}
-
Gets the color of the Mark.
This method is defined on marks of type:
LineAnnotation,StampAnnotation.Returns:
The color of the Mark as a hexadecimal string.
- Type
- string
Example
if (mark.getColor) { var color = mark.getColor(); } -
getEndHeadType() → {string|PCCViewer.Mark.LineHeadType}
-
Gets the line Mark end head type.
This method is defined on marks of type:
LineAnnotation.Returns:
A line head type enum value.
- Type
- string | PCCViewer.Mark.LineHeadType
Example
if (mark.getEndHeadType) { var endHeadType = mark.getEndHeadType(); } -
getEndPoint() → {Object}
-
Gets the end point coordinates of the line Mark.
This method is defined on marks of type:
LineAnnotation.Returns:
A point object of the type
{x: xvalue, y: yvalue}- Type
- Object
Example
if (mark.getEndPoint) { var endPoint = mark.getEndPoint(); } -
getFillColor() → {string}
-
Gets the fill color of the Mark.
This method is defined on marks of type:
RectangleAnnotation,EllipseAnnotation,TextAnnotation.Returns:
The fill color of the Mark as a hexadecimal string.
- Type
- string
Example
if (mark.getFillColor) { var fillColor = mark.getFillColor(); } -
getFontColor() → {string}
-
Gets the font color of the text contained in the Text Mark.
This method is defined on marks of type:
TextAnnotation,TextRedaction.Returns:
The text contained in the Text mark.
- Type
- string
Example
if (mark.getFontColor) { var text = mark.getFontColor(); } -
getFontName() → {string}
-
Gets the font color of the text contained in the Text Mark.
This method is defined on marks of type:
TextAnnotation,TextRedaction.Returns:
The text contained in the Text mark.
- Type
- string
Example
if (mark.getFontName) { var text = mark.getFontName(); } -
getFontSize() → {number}
-
Gets the font size (in points) of the text in the Text Mark.
This method is defined on marks of type:
TextAnnotation,TextRedaction.Returns:
The font size of the text in the text mark.
- Type
- number
Example
if (mark.getFontSize) { var fontSize = mark.getFontSize(); } -
getFontStyle() → {Array.<string>}
-
Gets an array of font styles of the text contained in the TextAnnotation mark.
This method is defined on marks of type:
TextAnnotation.Returns:
An array containing the font styles of text contained in the Text mark.
- Type
- Array.<string>
Example
if (mark.getFontStyle) { var fontStyleArray = mark.getFontStyle(); } -
getHorizontalAlignment() → {string}
-
Gets the horizontalAlignment of the text contained in the Text Mark.
This method is defined on marks of type:
TextAnnotation.- See:
Returns:
A string containing horizontalAlignment contained in the Text mark.
- Type
- string
Example
if (mark.getHorizontalAlignment) { var horizontalAlignment = mark.getHorizontalAlignment(); } -
getId() → {string}
-
Gets the ID of the Mark.
This method is defined on all Mark objects.
- See:
Returns:
The ID of the Mark.
- Type
- string
Example
var markId = mark.getId(); -
getLabel() → {string}
-
Gets the text string contained in the Stamp Mark.
This method is defined on marks of type:
StampAnnotation,StampRedaction.Returns:
The text string in the Stamp mark.
- Type
- string
Example
if (mark.getLabel) { var label = mark.getLabel(); } -
getOpacity() → {number}
-
Gets the opacity of the Mark. This value is a number between 0 and 255.
This method is defined on marks of type:
LineAnnotation,RectangleAnnotation,EllipseAnnotation,TextAnnotation.Returns:
The opacity of the line.
- Type
- number
Example
if (mark.getOpacity) { var opacity = mark.getOpacity(); } -
getPageNumber() → {number}
-
Gets the page number where the Mark object is located.
This method is defined on all Mark objects.
Returns:
The page number where the Mark is located.
- Type
- number
Example
var pageNumber = mark.getPageNumber(); -
getRectangle() → {Object}
-
Gets the bounding rectangle for the Mark.
This method is defined on marks of type:
RectangleAnnotation,EllipseAnnotation,TextAnnotation,StampAnnotation,RectangleRedaction,TextRedaction,StampRedaction.Returns:
A rectangle object of the type
{x: xValue, y: yValue, width: widthValue, height: heightValue}.- Type
- Object
Example
if (mark.getRectangle) { var boundingRectangle = mark.getRectangle(); } -
getStartPoint() → {Object}
-
Gets the start point coordinates of the line Mark.
This method is defined on marks of type:
LineAnnotation.Returns:
A point object of the type
{x: xvalue, y: yvalue}- Type
- Object
Example
if (mark.getStartPoint) { var startPoint = mark.getStartPoint(); } -
getText() → {string}
-
Gets the text contained in the Text Mark.
This method is defined on marks of type:
TextAnnotation,TextRedaction.Returns:
The text contained in the Text mark.
- Type
- string
Example
if (mark.getText) { var text = mark.getText(); } -
getThickness() → {number}
-
Gets the thickness of the line.
This method is defined on marks of type:
LineAnnotation.Returns:
The thickness of the line.
- Type
- number
Example
if (mark.getThickness) { var thickness = mark.getThickness(); } -
getType() → {string}
-
Gets the type of the Mark type.
This method is defined on all Mark objects.
- See:
-
- PCCViewer.Mark.Type for a list of possible Mark types.
- PCCViewer.Mark.Type
- PCCViewer.Mark#type
Returns:
The type of Mark.
- Type
- string
Example
switch (mark.getType()) { case PCCViewer.Mark.Type.LineAnnotation: ... break; default: ... } -
setBorderColor(value) → {PCCViewer.Mark}
-
Sets the border color of the Mark.
This property is defined on marks of type:
RectangleRedaction,EllipseAnnotation,TextAnnotation.Parameters:
Name Type Description valuestring Hexadecimal string representing border color. This string must be prepended with '#' character.
Returns:
the Mark object on which this method was called.
- Type
- PCCViewer.Mark
Example
if (mark.setBorderColor) { mark.setBorderColor("#FF0000"); // set the border color to red } -
setBorderThickness(value) → {PCCViewer.Mark}
-
Sets the border thickness of the mark.
This property is defined on marks of type:
RectangleAnnotation,EllipseAnnotation,TextAnnotation.Parameters:
Name Type Description valuenumber Border thickness of the mark.
Returns:
the Mark object on which this method was called.
- Type
- PCCViewer.Mark
Example
if (mark.setBorderThickness) { mark.setBorderThickness(3); } -
setColor(value) → {PCCViewer.Mark}
-
Sets the color of the Mark.
This method is defined on marks of type:
LineAnnotation,StampAnnotation.Parameters:
Name Type Description valuestring Hexadecimal string representing color. This string must be prepended with '#' character.
Returns:
the Mark object on which this method was called.
- Type
- PCCViewer.Mark
Example
if (mark.setColor) { mark.setColor("#FF0000"); // set the mark's color to red } -
setEndHeadType(value) → {PCCViewer.Mark}
-
Sets the line head type.
This method is defined on marks of type:
LineAnnotation.Parameters:
Name Type Description valuePCCViewer.Mark.LineHeadType The line head type. For example,
PCCViewer.Mark.LineHeadType.FilledRectanglecan be specified to make the line appear as an arrow.Returns:
the Mark object on which this method was called.
- Type
- PCCViewer.Mark
Example
if (mark.setEndHeadType) { // Put a triangle head on the end of the line to make it an arrow mark.setEndHeadType("FilledTriangle"); // or use the enumeration to accomplish the same thing mark.setEndHeadType(PCCViewer.Mark.LineHeadType.FilledTriangle); } -
setEndPoint(value) → {PCCViewer.Mark}
-
Sets the end point coordinate of the line Mark.
This method is defined on marks of type:
LineAnnotation.Parameters:
Name Type Description valueObject Start point coordinates of a line Mark. The parameter object must be of the following type:
{x: xvalue, y: yvalue}Returns:
the Mark object on which this method was called.
- Type
- PCCViewer.Mark
Example
if (mark.setEndPoint) { mark.setEndPoint({x:100, y:100}); } -
setFillColor(value) → {PCCViewer.Mark}
-
Sets the fill color of the Mark.
This method is defined on marks of type:
RectangleAnnotation,EllipseAnnotation,TextAnnotation.Parameters:
Name Type Description valuestring Hexadecimal string representing fill color. This string must be prepended with '#' character.
Returns:
the Mark object on which this method was called.
- Type
- PCCViewer.Mark
Example
if (mark.setFillColor) { mark.setFillColor("#FF0000"); // set the fill color to red } -
setFontColor(value) → {PCCViewer.Mark}
-
Sets the font color of the text in the Text Mark.
This method is defined on marks of type:
TextAnnotation,TextRedaction.Parameters:
Name Type Description valuestring A string value containing the hexadecimal color for the text of the text annotation.
Returns:
the Mark object on which this method was called.
- Type
- PCCViewer.Mark
Example
if (mark.setFontColor) { mark.setFontColor("#000000"); } -
setFontName(value) → {PCCViewer.Mark}
-
Sets the font name of the text in the Text Mark.
This method is defined on marks of type:
TextAnnotation,TextRedaction.Parameters:
Name Type Description valuestring A string value containing the font name for the text in the text annotation.
Returns:
the Mark object on which this method was called.
- Type
- PCCViewer.Mark
Example
if (mark.setFontName) { mark.setFontName("Aerial"); } -
setFontSize(value) → {PCCViewer.Mark}
-
Sets the font size (in points) for the text to use in the Text Mark.
Note: The API uses the resolution of the image to determine the size of a point so, for example, a line of 12 point text on a 300 DPI raster image will be 12 points / 72 point-per-inch * 300 pixels-per-inch = 50 pixels tall. The default value is 12 points.
This method is defined on marks of type:
TextAnnotation,TextRedaction.Parameters:
Name Type Description valuenumber A number for the font size for the text in the text annotation.
Returns:
the Mark object on which this method was called.
- Type
- PCCViewer.Mark
Example
if (mark.setFontSize) { mark.setFontSize(12); } -
setFontStyle(value) → {PCCViewer.Mark}
-
Sets the font styles provided in the parameter array of the text in the TextAnnotation mark.
This method is defined on marks of type:
TextAnnotation.Parameters:
Name Type Description valueArray.<string> An array containing values containing the font styles for the text in the text annotation.
Valid values in the array are:
- "Bold" (PCCViewer.Mark.FontStyles.Bold)
- "Italic" (PCCViewer.Mark.FontStyles.Italic)
- "Underline" (PCCViewer.Mark.FontStyles.Underline)
- "Strikeout" (PCCViewer.Mark.FontStyles.Strikeout)
Note: An empty array would render the text with normal font style.
Returns:
the Mark object on which this method was called.
- Type
- PCCViewer.Mark
Example
if (mark.setFontStyle) { var fontStylesArray = ["Bold","Italic","Underline"]; mark.setFontStyle(fontStylesArray); } -
setHorizontalAlignment(value) → {PCCViewer.Mark}
-
Sets the horizontal alignment of the text in the Text Mark.
This method is defined on marks of type:
TextAnnotation.Parameters:
Name Type Description valuestring A string value containing the horizontal alignment for the text in the text annotation.
- See:
Returns:
the Mark object on which this method was called.
- Type
- PCCViewer.Mark
Example
if (mark.setHorizontalAlignment) { mark.setHorizontalAlignment("center"); } -
setLabel(value) → {PCCViewer.Mark}
-
Sets the text string in the Stamp Mark.
This method is defined on marks of type:
StampAnnotation,StampRedaction.Parameters:
Name Type Description valuestring A string value containing the text in the Stamp annotation.
Returns:
the Mark object on which this method was called.
- Type
- PCCViewer.Mark
Example
if (mark.setLabel) { mark.setLabel("Approved"); } -
setOpacity(value) → {PCCViewer.Mark}
-
Sets the opacity of the Mark. This value is a number between 0 and 255.
This method is defined on marks of type:
LineAnnotation,RectangleAnnotation,EllipseAnnotation,TextAnnotation.Parameters:
Name Type Description valuenumber Opacity of the Mark. Accepatble values are in the range 0 to 255.
Returns:
the Mark object on which this method was called.
- Type
- PCCViewer.Mark
Example
if (mark.setOpacity) { mark.setOpacity(255); // fully opaque mark.setOpacity(127); // translucent mark.setOpacity(0); // transparent } -
setRectangle(value) → {PCCViewer.Mark}
-
Sets the bounding rectangle of the Mark.
This method is defined on marks of type:
RectangleAnnotation,EllipseAnnotation,TextAnnotation,StampAnnotation,RectangleRedaction,TextRedaction,StampRedaction.Parameters:
Name Type Description valueObject Bounding rectangle of a Mark. The parameter object must be of the following type:
{x: xValue, y: yValue, width: widthValue, height: heightValue}Returns:
the Mark object on which this method was called.
- Type
- PCCViewer.Mark
Example
if (mark.setRectangle) { mark.setRectangle({x:0, y:0, width:100, height:100}); } -
setStartPoint(value) → {PCCViewer.Mark}
-
Sets the start point coordinate of the line Mark.
This method is defined on marks of type:
LineAnnotation.Parameters:
Name Type Description valueObject Start point coordinates of a line Mark. The parameter object must be of the following type: {x:xvalue, y: yvalue}
Returns:
the Mark object on which this method was called.
- Type
- PCCViewer.Mark
Example
if (mark.setStartPoint) { mark.setStartPoint({x:1, y:1}); } -
setText(value) → {PCCViewer.Mark}
-
Sets the text in the Text Mark.
This method is defined on marks of type:
TextAnnotation,TextRedaction.Parameters:
Name Type Description valuestring Text of the Mark. Accepatble values is any string.
Returns:
the Mark object on which this method was called.
- Type
- PCCViewer.Mark
Example
if (mark.setText) { mark.setText("This is test Text"); } -
setThickness(value) → {PCCViewer.Mark}
-
Sets the thickness of line.
This method is defined on marks of type:
LineAnnotation.Parameters:
Name Type Description valuenumber Thickness of the line.
Returns:
the Mark object on which this method was called.
- Type
- PCCViewer.Mark
Example
if (mark.setThickness) { mark.setThickness(3); }