PageTree

Description

This role contains methods for querying and manipulating page tree nodes in a PDF.

Page Fragments

This class includes the methods:

  • `page-fragment` - create a detached page

  • `pages-fragment` - create a detached page sub-tree

  • `global-resources-scope - get or set shared resources across pages

These stand-alone fragments aim to be thread-safe to support parallel construction of pages. The final PDF assembly needs to be synchronous.

use PDF::Content::Page;
use PDF::Content::PageTree;
use lib 't';
use PDFTiny;

my PDFTiny $pdf .= new;
my PDF::Content::Page @pages;

@pages = (1..20).hyper(:batch(1)).map: -> $page-num {
    my PDF::Content::Page:D $page = PDF::Content::PageTree.page-fragment;
    $page.text: {
        .text-position = 50, 400;
        .say: "Page $page-num";
    }
    $page.finish;
    $page;
}

$pdf.add-page($_) for @pages;

Methods

This is an advanced setting that sets up a global resource dictionary. Any pages that are then directly created via `add-page` will use the global resources dictionary for fonts and XObjects, etc.

This may be of use in certain specialized cases, such as when the PDF is being used as a resource library. The resources will be able to be accessed later by opening the PDF, but without needing to go to any particular page.

PDF::Content v0.9.11

PDF content related classes; including text, images, fonts and graphics

Authors

  • David Warring

License

Artistic-2.0

Dependencies

Base64::NativeColorCompress::Zlib::RawFont::AFM:ver<1.24.10+>Native::PackingMethod::AlsoJSON::FastPDF:ver<0.6.8+>PDF::Grammar:ver<0.3.2+>

Test Dependencies

Provides

  • PDF::Content
  • PDF::Content::API
  • PDF::Content::Canvas
  • PDF::Content::Color
  • PDF::Content::Font
  • PDF::Content::Font::CoreFont
  • PDF::Content::Font::Enc::Glyphic
  • PDF::Content::Font::Enc::Type1
  • PDF::Content::Font::Encoder
  • PDF::Content::Font::Encodings
  • PDF::Content::FontObj
  • PDF::Content::Image
  • PDF::Content::Image::GIF
  • PDF::Content::Image::JPEG
  • PDF::Content::Image::PDF
  • PDF::Content::Image::PNG
  • PDF::Content::Interface
  • PDF::Content::Matrix
  • PDF::Content::Ops
  • PDF::Content::Page
  • PDF::Content::PageNode
  • PDF::Content::PageTree
  • PDF::Content::ResourceDict
  • PDF::Content::Resourced
  • PDF::Content::Tag
  • PDF::Content::Text::Block
  • PDF::Content::Text::Box
  • PDF::Content::Text::Line
  • PDF::Content::Text::Style
  • PDF::Content::XObject
  • X::PDF::Content

The Camelia image is copyright 2009 by Larry Wall. "Raku" is a trademark of the Yet Another Society. All rights reserved.

Built with Podlite — the markup and publishing tools behind this site.