Method: HexaPDF::Content::Canvas#marked_content_point

Defined in:
lib/hexapdf/content/canvas.rb

#marked_content_point(tag, property_list: nil) ⇒ Object

:call-seq:

canvas.marked_content_point(tag, property_list: nil)     -> canvas

Inserts a marked-content point, optionally associated with a property list. Returns self.

A marked-content point is used to identify a position in the content stream for later use by other applications. The symbol tag is used to uniquely identify the role of the marked-content point and should be registered with ISO to avoid conflicts.

The optional property_list argument can either be a valid PDF dictionary or a symbol referencing an already used property list in the resource dictionary’s /Properties dictionary.

Examples:

canvas.marked_content_point(:Divider)
canvas.marked_content_point(:Divider, property_list: {Key: 'value'})

See: PDF2.0 s14.6, #marked_content_sequence, #end_marked_content_sequence



2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
# File 'lib/hexapdf/content/canvas.rb', line 2461

def marked_content_point(tag, property_list: nil)
  raise_unless_at_page_description_level_or_in_text
  if property_list
    property_list = resources.property_list(property_list) if property_list.kind_of?(Symbol)
    invoke2(:DP, tag, resources.add_property_list(property_list))
  else
    invoke1(:MP, tag)
  end
  self
end