Skip to content

pdf-raku/PDF-Render-raku

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PDF-Render

Description

A simple PDF::API6 based renderer for an intermediate tagged PDF representation, typically produced from Pod, Markdown, or as application output.

Synopsis

use PDF::Render;

my %role-map = (
    'U' => :Span[:TextDecorationType<Underline>],
    'X' => :Index[],
);

my Pair:D $pdf-ast =
    :Document[ :Lang<en>,
        :H1["A basic Test Document"],
        :P["This text is ", :Em["italic"], "."],
        :P["This text is ", :Strong["bold"], "."],
        :P["This text is ", :U["underlined"], "."],
        :P["This text contains a link to ", :Link[:href("http://www.google.com/"), "google"], "."],

        "#comment" => " a real-world sample, converted from Supply.rakudoc",
        :P["A tap on an ", :Code[:X[ "on demand"]]," supply will initiate the ",
           "production of values and tapping the supply again may result in a new set of values.",
           "For example, ", :Code[:X["Supply.interval"]], " produces a fresh ",
           "timer with the appropriate interval each time it is tapped."],
     ];

my PDF::Render $renderer .= new: :%role-map;
my PDF::API6 $pdf = $renderer.render($pdf-ast);
$pdf.save-as: "example.pdf";

About

Simple PDF Tags based renderer

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages