Module: Pdfrb::Content::Operator

Defined in:
lib/pdfrb/content/operator.rb,
lib/pdfrb/content/parser.rb,
lib/pdfrb/content/operators/path.rb,
lib/pdfrb/content/operators/color.rb,
lib/pdfrb/content/operators/general.rb,
lib/pdfrb/content/operators/painting.rb,
lib/pdfrb/content/operators/text_state.rb,
lib/pdfrb/content/operators/text_showing.rb,
lib/pdfrb/content/operators/marked_content.rb,
lib/pdfrb/content/operators/text_positioning.rb,
lib/pdfrb/content/operators/graphics_state_params.rb

Overview

Operator catalogue. Each PDF content operator (q, m, Tj, ...) is implemented by a subclass of Operator::Base that registers itself in REGISTRY at file load.

Adding a new operator = adding one subclass + register. No switch edits (open/closed). Mirrors the postscript gem's Model::Operators pattern.

Defined Under Namespace

Classes: ApplyExtGState, Base, BeginMarkedContent, BeginMarkedContentWithProperties, BeginText, CharSpacing, CloseAndStroke, CloseFillStrokeEvenOdd, CloseFillStrokeNonZero, ClosePath, ConcatMatrix, CurveTo, CurveToFirstReflected, CurveToLastEqual, DashPattern, EndMarkedContent, EndPath, EndText, FillCMYK, FillDeprecatedAlias, FillEvenOdd, FillGray, FillNonZero, FillRGB, FillStrokeEvenOdd, FillStrokeNonZero, Flatness, Font, HorizontalScaling, Leading, LineCap, LineJoin, LineTo, LineWidth, MarkedContentPoint, MarkedContentPointWithProperties, MiterLimit, MoveTo, MoveToNextLineShowText, NextLine, NoArg, Rectangle, RenderingIntent, RenderingMode, RestoreGraphicsState, Rise, SaveGraphicsState, SetFillColor, SetFillColorN, SetFillColorSpace, SetSpacingMoveToShowText, SetStrokeColor, SetStrokeColorN, SetStrokeColorSpace, SetTextMatrix, ShowText, ShowTextWithSpacing, Stroke, StrokeCMYK, StrokeGray, StrokeRGB, TextTranslate, TextTranslateSetLeading, Unknown, WordSpacing

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.registryObject (readonly)

Returns the value of attribute registry.



16
17
18
# File 'lib/pdfrb/content/operator.rb', line 16

def registry
  @registry
end

Class Method Details

.[](name) ⇒ Object



22
23
24
# File 'lib/pdfrb/content/operator.rb', line 22

def [](name)
  @registry[name.to_s]
end

.namesObject



26
27
28
# File 'lib/pdfrb/content/operator.rb', line 26

def names
  @registry.keys
end

.register(name, klass) ⇒ Object



18
19
20
# File 'lib/pdfrb/content/operator.rb', line 18

def register(name, klass)
  @registry[name.to_s] = klass
end