PDF-Content-raku

[Raku PDF Project] / [PDF-Content Module] / PDF::Content :: Canvas

A graphical content container such as a page, xobject form, or pattern

this role is applied to PDF::Content::Page and PDF::Content::XObject['Form'].

method gfx

method gfx(
    |c
) returns PDF::Content

appended graphics return appended PDF content stream

method pre-gfx

method pre-gfx() returns PDF::Content

return prepended graphics

method next-mcid

method next-mcid() returns UInt:D

Allocate the next MCID (Marked Content Identifier)

method contents

method contents() returns Str

return contents

method contents-parse

method contents-parse() returns Mu

reparse contents

method render

method render(
    Bool :$tidy = Bool::True,
    |c
) returns PDF::Content

render graphics

method finish

method finish() returns Mu

finish for serialization purposes

method xobject-form

method xobject-form(
    :$group = Bool::True,
    *%dict
) returns PDF::Content::XObject

create a child XObject Form

method tiling-pattern

method tiling-pattern(
    List :$BBox!,
    Numeric :$XStep = Code.new,
    Numeric :$YStep = Code.new,
    Int :$PaintType = 1,
    Int :$TilingType = 1,
    Hash :$Resources = Code.new,
    *%dict
) returns PDF::Content::XObject

create a new Type 1 (Tiling) Pattern

method save-as-image

method save-as-image(
    Str $outfile where { ... },
    |c
) returns Mu

draft rendering via Cairo (experimental)

The PDF::To::Cairo module must be installed to use this method

has PDF::Content::Canvas::TagSetBuilder $.tags

snapshot of previous, and currently open tags