Class Index

Classes


Class PDFNet.GState

PDFNet.GState

Class Summary
Constructor Attributes Constructor Name and Description
 
GState is a class that keeps track of a number of style attributes used to visually define graphical Elements.
Method Summary
Method Attributes Method Name and Description
 
concat(a, b, c, d, h, v)
Concatenate the given matrix expressed in its values to the transformation matrix of this element.
 
Concatenate the given matrix to the transformation matrix of this element.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
<static>  
PDFNet.GState.getRenderingIntentType(name)
A utility function that maps a string representing a rendering intent to RenderingIntent type.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
specifies if the alpha is to be interpreted as a shape or opacity mask.
 
Specify whether to apply automatic stroke adjustment.
 
Sets black-generation function used during conversion between DeviceRGB and DeviceCMYK.
 
Sets the current blend mode to be used in the transparent imaging model.
 
setCharSpacing(char_spacing)
Sets character spacing.
 
setDashPattern(buf_dash_array, phase)
[Documentation Not Yet Added]
 
setFillColor(pattern, c)
Set the fill color to the given uncolored tiling pattern.
 
Sets the color space used for filling operations
 
Sets the color value/point used for filling operations.
 
Set the fill color to the given tiling pattern.
 
Sets the opacity value for painting operations other than stroking.
 
specifies if overprint is enabled for fill operations.
 
setFlatness(flatness)
Sets the value of flatness tolerance.
 
setFont(font, font_sz)
Sets the font and font size used to draw text.
 
 
Sets horizontal scale.
 
setLeading(leading)
Sets the leading parameter.
 
Sets LineCap style property.
 
Sets LineJoin style property.
 
setLineWidth(width)
Sets the thickness of the line used to stroke a path.
 
setMiterLimit(miter_limit)
Sets miter limit.
 
Sets the overprint mode.
 
Sets the color intent to be used for rendering the Element.
 
Sets the smoothness tolerance used to control the quality of smooth shading.
 
Sets the soft mask of the extended graphics state.
 
setStrokeColor(pattern, c)
Set the stroke color to the given uncolored tiling pattern.
 
Sets the color space used for stroking operations
 
Sets the color value/point used for stroking operations.
 
Set the stroke color to the given tiling pattern.
 
Sets opacity value for stroke painting operations for paths and glyph outlines.
 
specifies if overprint is enabled for stroke operations.
 
setTextKnockout(knockout)
Mark the object as elementary for purposes of color compositing in the transparent imaging model.
 
Sets text rendering mode.
 
Sets text rise.
 
Sets transfer function used during color conversion process.
 
setTransform(a, b, c, d, h, v)
Set the transformation matrix associated with this element.
 
Set the transformation matrix associated with this element.
 
Sets undercolor-removal function used during conversion between DeviceRGB and DeviceCMYK.
 
setWordSpacing(word_spacing)
Sets word spacing.
Class Detail
PDFNet.GState(id)
GState is a class that keeps track of a number of style attributes used to visually define graphical Elements. Each PDF::Element has an associated GState that can be used to query or set various graphics properties.
Parameters:
id
Method Detail
concat(a, b, c, d, h, v)
Concatenate the given matrix expressed in its values to the transformation matrix of this element.
Parameters:
{number} a
horizontal 'scaling' component of the new text matrix.
{number} b
'rotation' component of the new text matrix.
{number} c
vertical 'scaling' component of the new text matrix.
{number} d
'rotation' component of the new text matrix.
{number} h
horizontal translation component of the new text matrix.
{number} v
vertical translation component of the new text matrix.

concatMatrix(mtx)
Concatenate the given matrix to the transformation matrix of this element.
Parameters:
{matrix2d} mtx
Matrix2D object to concatenate the current matrix with.

{boolean} getAISFlag()
Returns:
{boolean} A promise that resolves to the alpha source flag ('alpha is shape'), specifying whether the current soft mask and alpha constant are to be interpreted as shape values (true) or opacity values (false).

{boolean} getAutoStrokeAdjust()
Returns:
{boolean} A promise that resolves to a flag specifying whether stroke adjustment is enabled in the graphics state. Corresponds to the /SA key within the ExtGState's dictionary.

{Obj} getBlackGenFunct()
Returns:
{Obj} A promise that resolves to currently selected black-generation function (NULL by default) used during conversion between DeviceRGB and DeviceCMYK. Corresponds to the /BG key within the ExtGState's dictionary.

{number} getBlendMode()
Return value enum:
PDFNet.GState.BlendMode = {
	e_bl_compatible : 0
	e_bl_normal : 1
	e_bl_multiply : 2
	e_bl_screen : 3
	e_bl_difference : 4
	e_bl_darken : 5
	e_bl_lighten : 6
	e_bl_color_dodge : 7
	e_bl_color_burn : 8
	e_bl_exclusion : 9
	e_bl_hard_light : 10
	e_bl_overlay : 11
	e_bl_soft_light : 12
	e_bl_luminosity : 13
	e_bl_hue : 14
	e_bl_saturation : 15
	e_bl_color : 16
}
Returns:
{number} A promise that resolves to the current blend mode to be used in the transparent imaging model. Corresponds to the /BM key within the ExtGState's dictionary.

{number} getCharSpacing()
Returns:
{number} A promise that resolves to currently selected character spacing. The character spacing parameter is a number specified in unscaled text space units. When the glyph for each character in the string is rendered, the character spacing is added to the horizontal or vertical component of the glyph's displacement, depending on the writing mode. See Section 5.2.1 in PDF Reference Manual for details.

{colorpt} getFillColor()
Returns:
{colorpt} A promise that resolves to a color value/point represented in the current fill color space

{ColorSpace} getFillColorSpace()
Returns:
{ColorSpace} A promise that resolves to color space used for filling

{number} getFillOpacity()
Returns:
{number} A promise that resolves to the opacity value for painting operations other than stroking. Returns the value of the /ca key in the ExtGState dictionary. If the value is not found, the default value of 1 is returned.

{boolean} getFillOverprint()
Returns:
{boolean} A promise that resolves to whether overprint is enabled for fill painting operations. Corresponds to the /op key within the ExtGState's dictionary.

{PatternColor} getFillPattern()
Returns:
{PatternColor} A promise that resolves to the pattern color of currently selected pattern color space used for filling.

{number} getFlatness()
Returns:
{number} A promise that resolves to current value of flatness tolerance Flatness is a number in the range 0 to 100; a value of 0 specifies the output device's default flatness tolerance. The flatness tolerance controls the maximum permitted distance in device pixels between the mathematically correct path and an approximation constructed from straight line segments.

{Font} getFont()
Returns:
{Font} A promise that resolves to currently selected font

{number} getFontSize()
Returns:
{number} A promise that resolves to the font size

{Obj} getHalftone()
Returns:
{Obj} A promise that resolves to currently selected halftone dictionary or stream (NULL by default). Corresponds to the /HT key within the ExtGState's dictionary. Halftoning is a process by which continuous-tone colors are approximated on an output device that can achieve only a limited number of discrete colors.

{number} getHorizontalScale()
Returns:
{number} A promise that resolves to currently selected horizontal scale The horizontal scaling parameter adjusts the width of glyphs by stretching or compressing them in the horizontal direction. Its value is specified as a percentage of the normal width of the glyphs, with 100 being the normal width. The scaling always applies to the horizontal coordinate in text space, independently of the writing mode. See Section 5.2.3 in PDF Reference Manual for details.

{number} getLeading()
Returns:
{number} A promise that resolves to currently selected leading parameter The leading parameter is measured in unscaled text space units. It specifies the vertical distance between the baselines of adjacent lines of text. See Section 5.2.4 in PDF Reference Manual for details.

{number} getLineCap()
Return value enum:
PDFNet.GState.LineCap = {
	e_butt_cap : 0
	e_round_cap : 1
	e_square_cap : 2
}
Returns:
{number} A promise that resolves to currently selected LineCap style The line cap style specifies the shape to be used at the ends of open sub-paths (and dashes, if any) when they are stroked.

{number} getLineJoin()
Return value enum:
PDFNet.GState.LineJoin = {
	e_miter_join : 0
	e_round_join : 1
	e_bevel_join : 2
}
Returns:
{number} A promise that resolves to currently selected LineJoin style The line join style specifies the shape to be used at the corners of paths that are stroked.

{number} getLineWidth()
Returns:
{number} A promise that resolves to the thickness of the line used to stroke a path.

{number} getMiterLimit()
Returns:
{number} A promise that resolves to current value of miter limit. The miter limit imposes a maximum on the ratio of the miter length to the line width. When the limit is exceeded, the join is converted from a miter to a bevel.

{number} getOverprintMode()
Returns:
{number} A promise that resolves to the overprint mode used by this graphics state. Corresponds to the /OPM key within the ExtGState's dictionary.

{number} getPhase()
Returns:
{number} A promise that resolves to the phase of the currently selected dash pattern. dash phase is expressed in user space units.

{number} getRenderingIntent()
Return value enum:
PDFNet.GState.RenderingIntent = {
	e_absolute_colorimetric : 0
	e_relative_colorimetric : 1
	e_saturation : 2
	e_perceptual : 3
}
Returns:
{number} A promise that resolves to the color intent to be used for rendering the Element

<static> {number} PDFNet.GState.getRenderingIntentType(name)
A utility function that maps a string representing a rendering intent to RenderingIntent type.
Return value enum:
PDFNet.GState.RenderingIntent = {
	e_absolute_colorimetric : 0
	e_relative_colorimetric : 1
	e_saturation : 2
	e_perceptual : 3
}
Parameters:
{string} name
string that represents the rendering intent to get.
Returns:
{number} A promise that resolves to the color rendering intent type matching the specified string

{number} getSmoothnessTolerance()
Returns:
{number} A promise that resolves to the smoothness tolerance used to control the quality of smooth shading. Corresponds to the /SM key within the ExtGState's dictionary. The allowable error (or tolerance) is expressed as a fraction of the range of the color component, from 0.0 to 1.0.

{Obj} getSoftMask()
Returns:
{Obj} A promise that resolves to associated soft mask. NULL if the soft mask is not selected or SDF dictionary representing the soft mask otherwise.

{matrix2d} getSoftMaskTransform()
Returns:
{matrix2d} A promise that resolves to the soft mask transform. This is the transformation matrix at the moment the soft mask is established in the graphics state with the gs operator. This information is only relevant when applying the soft mask that may be specified in the graphics state to the current element.

{colorpt} getStrokeColor()
Returns:
{colorpt} A promise that resolves to a color value/point represented in the current stroke color space

{ColorSpace} getStrokeColorSpace()
Returns:
{ColorSpace} A promise that resolves to color space used for stroking

{number} getStrokeOpacity()
Returns:
{number} A promise that resolves to opacity value for stroke painting operations for paths and glyph outlines. Returns the value of the /CA key in the ExtGState dictionary. If the value is not found, the default value of 1 is returned.

{boolean} getStrokeOverprint()
Returns:
{boolean} A promise that resolves to whether overprint is enabled for stroke painting operations. Corresponds to the /OP key within the ExtGState's dictionary.

{PatternColor} getStrokePattern()
Returns:
{PatternColor} A promise that resolves to the SDF pattern object of currently selected PatternColorSpace used for stroking.

{number} getTextRenderMode()
Return value enum:
PDFNet.GState.TextRenderingMode = {
	e_fill_text : 0
	e_stroke_text : 1
	e_fill_stroke_text : 2
	e_invisible_text : 3
	e_fill_clip_text : 4
	e_stroke_clip_text : 5
	e_fill_stroke_clip_text : 6
	e_clip_text : 7
}
Returns:
{number} A promise that resolves to current text rendering mode. The text rendering mode determines whether showing text causes glyph outlines to be stroked, filled, used as a clipping boundary, or some combination of the three. See Section 5.2.5 in PDF Reference Manual for details..

{number} getTextRise()
Returns:
{number} A promise that resolves to current value of text rise Text rise specifies the distance, in unscaled text space units, to move the baseline up or down from its default location. Positive values of text rise move the baseline up

{Obj} getTransferFunct()
Returns:
{Obj} A promise that resolves to currently selected transfer function (NULL by default) used during color conversion process. A transfer function adjusts the values of color components to compensate for nonlinear response in an output device and in the human eye. Corresponds to the /TR key within the ExtGState's dictionary.

{matrix2d} getTransform()
Returns:
{matrix2d} A promise that resolves to the transformation matrix for this element.

{Obj} getUCRFunct()
Returns:
{Obj} A promise that resolves to currently selected undercolor-removal function (NULL by default) used during conversion between DeviceRGB and DeviceCMYK. Corresponds to the /UCR key within the ExtGState's dictionary.

{number} getWordSpacing()
Returns:
{number} A promise that resolves to currently selected word spacing Word spacing works the same way as character spacing, but applies only to the space character (char code 32). See Section 5.2.2 in PDF Reference Manual for details.

{boolean} isTextKnockout()
Returns:
{boolean} A promise that resolves to a boolean flag that determines the text element is considered elementary objects for purposes of color compositing in the transparent imaging model.

setAISFlag(AIS)
specifies if the alpha is to be interpreted as a shape or opacity mask. The alpha source flag ('alpha is shape'), specifies whether the current soft mask and alpha constant are to be interpreted as shape values (true) or opacity values (false).
Parameters:
{boolean} AIS
true for interpretation as shape values or false for opacity values

setAutoStrokeAdjust(SA)
Specify whether to apply automatic stroke adjustment. Corresponds to the /SA key within the ExtGState's dictionary.
Parameters:
{boolean} SA
if true automatic stroke adjustment will be applied.

setBlackGenFunct(BG)
Sets black-generation function used during conversion between DeviceRGB and DeviceCMYK. Corresponds to the /BG key within the ExtGState's dictionary.
Parameters:
{Obj} BG
SDF/Cos black-generation function or name

setBlendMode(BM)
Sets the current blend mode to be used in the transparent imaging model. Corresponds to the /BM key within the ExtGState's dictionary.
Parameters:
{number} BM
New blending mode type.

setCharSpacing(char_spacing)
Sets character spacing.
Parameters:
{number} char_spacing
a number specified in unscaled text space units. When the glyph for each character in the string is rendered, the character spacing is added to the horizontal or vertical component of the glyph's displacement, depending on the writing mode. See Section 5.2.1 in PDF Reference Manual for details.

setDashPattern(buf_dash_array, phase)
[Documentation Not Yet Added]
Parameters:
{Array} buf_dash_array
(generated documentation)
{number} phase
(generated documentation)

setFillColor(pattern, c)
Set the fill color to the given uncolored tiling pattern.
Parameters:
{PatternColor} pattern
PatternColor (PatternType = 1 and PaintType = 2) object.
{colorpt} c
is a color in the pattern's underlying color space.

setFillColorSpace(cs)
Sets the color space used for filling operations
Parameters:
{ColorSpace} cs
ColorSpace object to use for filling operations

setFillColorWithColorPt(c)
Sets the color value/point used for filling operations.
Parameters:
{colorpt} c
the color used for filling operations The color value must be represented in the currently selected color space used for filling.

setFillColorWithPattern(pattern)
Set the fill color to the given tiling pattern.
Parameters:
{PatternColor} pattern
New pattern color.

setFillOpacity(ca)
Sets the opacity value for painting operations other than stroking. Corresponds to the value of the /ca key in the ExtGState dictionary.
Parameters:
{number} ca
value to set fill opacity to

setFillOverprint(op)
specifies if overprint is enabled for fill operations. Corresponds to the /op key within the ExtGState's dictionary.
Parameters:
{boolean} op
true to enable overprint for fill, false to disable.

setFlatness(flatness)
Sets the value of flatness tolerance.
Parameters:
{number} flatness
is a number in the range 0 to 100; a value of 0 specifies the output device's default flatness tolerance. The flatness tolerance controls the maximum permitted distance in device pixels between the mathematically correct path and an approximation constructed from straight line segments.

setFont(font, font_sz)
Sets the font and font size used to draw text.
Parameters:
{Font} font
Font to draw the text with
{number} font_sz
size of the font to draw the text with

setHalftone(HT)
Parameters:
{Obj} HT
SDF/Cos halftone dictionary, stream, or name
Returns:
currently selected halftone dictionary or stream (NULL by default). Corresponds to the /HT key within the ExtGState's dictionary. Halftoning is a process by which continuous-tone colors are approximated on an output device that can achieve only a limited number of discrete colors.

setHorizontalScale(hscale)
Sets horizontal scale. The horizontal scaling parameter adjusts the width of glyphs by stretching or compressing them in the horizontal direction. Its value is specified as a percentage of the normal width of the glyphs, with 100 being the normal width. The scaling always applies to the horizontal coordinate in text space, independently of the writing mode. See Section 5.2.3 in PDF Reference Manual for details.
Parameters:
{number} hscale
value to set horizontal scale to.

setLeading(leading)
Sets the leading parameter. The leading parameter is measured in unscaled text space units. It specifies the vertical distance between the baselines of adjacent lines of text. See Section 5.2.4 in PDF Reference Manual for details.
Parameters:
{number} leading
number representing vertical distance between lines of text

setLineCap(cap)
Sets LineCap style property. The line cap style specifies the shape to be used at the ends of open subpaths (and dashes, if any) when they are stroked.
Parameters:
{number/enum} cap
(generated enum documentation)
PDFNet.GState.LineCap = {
	e_butt_cap : 0
	e_round_cap : 1
	e_square_cap : 2
}

setLineJoin(join)
Sets LineJoin style property. The line join style specifies the shape to be used at the corners of paths that are stroked.
Parameters:
{number/enum} join
(generated enum documentation)
PDFNet.GState.LineJoin = {
	e_miter_join : 0
	e_round_join : 1
	e_bevel_join : 2
}

setLineWidth(width)
Sets the thickness of the line used to stroke a path.
Parameters:
{number} width
a non-negative number expressed in user space units. A line width of 0 denotes the thinnest line that can be rendered at device resolution: 1 device pixel wide.

setMiterLimit(miter_limit)
Sets miter limit.
Parameters:
{number} miter_limit
A number that imposes a maximum on the ratio of the miter length to the line width. When the limit is exceeded, the join is converted from a miter to a bevel.

setOverprintMode(OPM)
Sets the overprint mode. Corresponds to the /OPM key within the ExtGState's dictionary.
Parameters:
{number} OPM
overprint mode.

setRenderingIntent(intent)
Sets the color intent to be used for rendering the Element.
Parameters:
{number/enum} intent
(generated enum documentation)
PDFNet.GState.RenderingIntent = {
	e_absolute_colorimetric : 0
	e_relative_colorimetric : 1
	e_saturation : 2
	e_perceptual : 3
}

setSmoothnessTolerance(SM)
Sets the smoothness tolerance used to control the quality of smooth shading. Corresponds to the /SM key within the ExtGState's dictionary.
Parameters:
{number} SM
(generated documentation)

setSoftMask(SM)
Sets the soft mask of the extended graphics state. Corresponds to the /SMask key within the ExtGState's dictionary.
Parameters:
{Obj} SM
SDF/Cos black-generation function or name

setStrokeColor(pattern, c)
Set the stroke color to the given uncolored tiling pattern.
Parameters:
{PatternColor} pattern
pattern (PatternType = 1 and PaintType = 2) object.
{colorpt} c
is a color in the pattern's underlying color space.

setStrokeColorSpace(cs)
Sets the color space used for stroking operations
Parameters:
{ColorSpace} cs
ColorSpace object to use for stroking operations

setStrokeColorWithColorPt(c)
Sets the color value/point used for stroking operations.
Parameters:
{colorpt} c
is the color used for stroking operations

setStrokeColorWithPattern(pattern)
Set the stroke color to the given tiling pattern.
Parameters:
{PatternColor} pattern
SDF pattern object.

setStrokeOpacity(ca)
Sets opacity value for stroke painting operations for paths and glyph outlines. Corresponds to the value of the /CA key in the ExtGState dictionary.
Parameters:
{number} ca
value to set stroke opacity to

setStrokeOverprint(OP)
specifies if overprint is enabled for stroke operations. Corresponds to the /OP key within the ExtGState's dictionary.
Parameters:
{boolean} OP
true to enable overprint for stroke, false to disable.

setTextKnockout(knockout)
Mark the object as elementary for purposes of color compositing in the transparent imaging model.
Parameters:
{boolean} knockout
Whether an object is elementary or not.

setTextRenderMode(rmode)
Sets text rendering mode. The text rendering mode determines whether showing text causes glyph outlines to be stroked, filled, used as a clipping boundary, or some combination of the three. See Section 5.2.5 in PDF Reference Manual for details..
Parameters:
{number} rmode
the mode that text will rendered with. rmode can take the following values: PDFNet.GState.TextRenderingMode = { e_fill_text : 0, e_stroke_text : 1, e_fill_stroke_text : 2, e_invisible_text : 3, e_fill_clip_text : 4, e_stroke_clip_text : 5, e_fill_stroke_clip_text : 6, e_clip_text : 7 }

setTextRise(rise)
Sets text rise. Text rise specifies the distance, in unscaled text space units, to move the baseline up or down from its default location. Positive values of text rise move the baseline up
Parameters:
{number} rise
distance to move baseline up. Negative values move baseline down.

setTransferFunct(TR)
Sets transfer function used during color conversion process. A transfer function adjusts the values of color components to compensate for nonlinear response in an output device and in the human eye. Corresponds to the /TR key within the ExtGState's dictionary.
Parameters:
{Obj} TR
SDF/Cos transfer function, array, or name

setTransform(a, b, c, d, h, v)
Set the transformation matrix associated with this element. A transformation matrix in PDF is specified by six numbers, usually in the form of an array containing six elements. In its most general form, this array is denoted [a b c d h v]; it can represent any linear transformation from one coordinate system to another. For more information about PDF matrices please refer to section 4.2.2 'Common Transformations' in PDF Reference Manual, and to documentation for pdftron::Common::Matrix2D class.
Parameters:
{number} a
horizontal 'scaling' component of the new text matrix.
{number} b
'rotation' component of the new text matrix.
{number} c
vertical 'scaling' component of the new text matrix.
{number} d
'rotation' component of the new text matrix.
{number} h
horizontal translation component of the new text matrix.
{number} v
vertical translation component of the new text matrix.

setTransformMatrix(mtx)
Set the transformation matrix associated with this element.
Parameters:
{matrix2d} mtx
The new transformation for this text element.

setUCRFunct(UCR)
Sets undercolor-removal function used during conversion between DeviceRGB and DeviceCMYK. Corresponds to the /UCR key within the ExtGState's dictionary.
Parameters:
{Obj} UCR
SDF/Cos undercolor-removal function or name

setWordSpacing(word_spacing)
Sets word spacing.
Parameters:
{number} word_spacing
a number specified in unscaled text space units. Word spacing works the same way as character spacing, but applies only to the space character (char code 32). See Section 5.2.2 in PDF Reference Manual for details.

Documentation generated by JsDoc Toolkit 2.4.0 on Fri Sep 09 2016 14:32:40 GMT-0700 (PDT)