PDF Stream Object Base Class

PDF Stream Object Base Class

Public fields

attrib

TODO

transform

TODO

parent_attrib

TODO

parent_transform

TODO Initialize a stream object

Active bindings

alphas

all alpha channels

gs_name

current GS name TODO: insert PDF spec reference

gs_spec

current gs_spec

clipping_spec

current clipping spec Use clip_polygon if specified. Use clip_rect if specified else NULL

paint_spec

path painting style based upon which of fill/stroke are NULL One of 'n', 's', 'f', 'b'

Methods

Public methods


Method new()

Usage

PDFStream$new(...)

Arguments

...

stream attributes Update the attributes of an object.e.g. update the x coordinate: obj$update(x = 12)


Method update()

Usage

PDFStream$update(
  ...,
  fontsize,
  text_mode,
  fill,
  stroke,
  linewidth,
  linetype,
  clip_rect
)

Arguments

...

named attributes

fontsize, text_mode, fill, stroke, linewidth, linetype, clip_rect

common drawing attributes


Method copy()

Clone the object Convert to full PDF object representation include stream/endstream and length dict.

Usage

PDFStream$copy()


Method as_object()

Usage

PDFStream$as_object(obj_idx)

Arguments

obj_idx

the index to use for this object in the PDF document


Method print()

Cat just the inner stream part of the object when print()ed

Usage

PDFStream$print(...)

Arguments

...

arguments passed to PDFStream$as_character(...) Transformations: rotate


Method rotate()

Usage

PDFStream$rotate(degrees, x = 0, y = 0)

Arguments

degrees

angle of rotation

x, y

rotate around this point. default (0,1) Transformations: translate


Method translate()

Usage

PDFStream$translate(x, y)

Arguments

x, y

translation distance Transformations: scale


Method scale()

Usage

PDFStream$scale(x, y = x)

Arguments

x, y

scale factors in x and y directions. If only x scale is given, then this value will also be used for the y scale factor Convenience method for changing core attribute: fontsize


Method fontsize()

Usage

PDFStream$fontsize(fontsize = 12)

Arguments

fontsize

fontsize default: 12 Convenience method for changing core attribute: text_mode


Method text_mode()

Usage

PDFStream$text_mode(text_mode = 0)

Arguments

text_mode

text mode. default 0. TODO: insert reference to PDF spec Convenience method for changing core attribute: fill colour


Method fill()

Usage

PDFStream$fill(fill = "#000000")

Arguments

fill

fill colour. default '#000000' Convenience method for changing core attribute: stroke colour


Method stroke()

Usage

PDFStream$stroke(stroke = "#000000")

Arguments

stroke

stroke colour. default: '#000000' Convenience method for changing core attribute: linewidth


Method linewidth()

Usage

PDFStream$linewidth(linewidth = 1)

Arguments

linewidth

linewidth. default: 1 Convenience method for changing core attribute: fontsize


Method linetype()

Usage

PDFStream$linetype(linetype = 0)

Arguments

linetype

linetype. default: 0. TODO: Insert reference to PDF spec Convenience method for changing core attribute: clipping rect


Method clip_rect()

Usage

PDFStream$clip_rect(x, y, width, height)

Arguments

x, y, width, height

dimensions of current clipping rect Convenience method for changing core attribute: clip polygon


Method clip_polygon()

Usage

PDFStream$clip_polygon(xs, ys)

Arguments

xs, ys

coords of clipping polygon convert stream object to character string


Method as_character()

Usage

PDFStream$as_character(...)

Arguments

...

ignored


Method get_transform_spec()

Full transform of all parent objects and this object's transform

Usage

PDFStream$get_transform_spec()


Method get_attrib()

Normalised full set of attributes including parent attributes if available

Usage

PDFStream$get_attrib()


Method clone()

The objects of this class are cloneable with this method.

Usage

PDFStream$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.