Skip to content

Commit

Permalink
document spanned content
Browse files Browse the repository at this point in the history
  • Loading branch information
dwarring committed Nov 13, 2023
1 parent 12fb581 commit 7d92293
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,51 @@ $page.graphics: -> $gfx {

```

### Content Continuation

Content sometimes needs to be continued across graphics objects, such as a paragraph that
spans multiple pages. The `mark` method may be called repeatably to achieve this:

```raku
use PDF::Class;
use PDF::Tags;
use PDF::Tags::Elem;
use PDF::Page;
use PDF::Content::FontObj;

my PDF::Class $pdf .= new;
my PDF::Tags $tags .= create: :$pdf;
my PDF::Tags::Elem $doc = $tags.Document;
my PDF::Page $page = $pdf.add-page;
my PDF::Content::FontObj $font = $pdf.core-font: :family<Helvetica>;
my PDF::Tags::Elem $para = $doc.Paragraph;

$page.graphics: -> $gfx {

$para.mark: $gfx, {
.say('This paragraph starts on first page...',
:$font,
:font-size(15),
:position[50, 600]);
};

}

$page = $pdf.add-page;
$page.graphics: -> $gfx {

$para.mark: $gfx, {
.say('...and finishes on the second page',
:$font,
:font-size(15),
:position[50, 600]);
};

}

$pdf.save-as: "span.pdf";
```

### Tagging and Metadata

If a PDF document is tagged for accessibility, additional metadata usually also needs to be set-up; typically `Title`, `Author`, `Subject`, `Keywords` and language. For example:
Expand Down

0 comments on commit 7d92293

Please sign in to comment.