Inkscape
Vector Graphics Editor
Loading...
Searching...
No Matches
Inkscape::Extension::Internal::PdfBuilder::PageContext Class Reference

#include <build-page.h>

Inheritance diagram for Inkscape::Extension::Internal::PdfBuilder::PageContext:
Inkscape::Extension::Internal::PdfBuilder::DrawContext

Public Member Functions

 PageContext (Document &doc, SPPage const *page)
 
void set_pagebox (CapyPDF_Page_Box type, Geom::Rect const &size)
 
void paint_drawing (CapyPDF_TransparencyGroupId drawing_id, Geom::Affine const &affine)
 Paint the entire canvas as a transparency group.
 
void add_anchors_for_page (SPPage const *page)
 Add any saved anchors (currently cached in the Document) to this page.
 
void annotate (CapyPDF_AnnotationId aid)
 Add the created annotation to the page.
 
- Public Member Functions inherited from Inkscape::Extension::Internal::PdfBuilder::DrawContext
 DrawContext (Document &doc, capypdf::DrawContext ctx, bool soft_mask)
 
 ~DrawContext ()=default
 
void paint_item (SPItem const *item, Geom::Affine const &tr=Geom::identity(), SPStyle const *context_style=nullptr)
 Paint the given object into the given context, making groups if needed.
 
void paint_item_group (SPGroup const *group, SPStyle const *context_style)
 
void paint_item_clone (SPUse const *use, SPStyle const *context_style)
 Paint the given clone object, finding or generating a transparency group from it.
 
void paint_group (CapyPDF_TransparencyGroupId child_id, SPStyle const *style=nullptr, Geom::Affine const &tr=Geom::identity(), std::optional< CapyPDF_TransparencyGroupId > soft_mask={})
 Paint a child group at the requested location.
 
void paint_shape (SPShape const *shape, SPStyle const *context_style)
 Paint a single shape path.
 
void paint_raster (SPImage const *image)
 Draw the raster data stored in URI into the PDF context.
 
void paint_item_to_raster (SPItem const *item, Geom::Affine const &tr, double resolution, bool antialias)
 Draw an item as a bitmap and return.
 
void paint_text_layout (Text::Layout const &layout, SPStyle const *context_style)
 Paint the given layout into the PDF document Drawing content.
 
void clip_text_layout (Text::Layout const &layout)
 Use the text object as a clipping mask in the PDF.
 
void start_ocg (CapyPDF_OptionalContentGroupId ocgid)
 
void end_ocg ()
 
bool set_shape (SPShape const *shape)
 
bool set_shape_pathvector (Geom::PathVector const &pathv)
 
void set_clip_path (std::optional< Geom::PathVector > clip, SPStyle *style=nullptr)
 Apply the clip path to the existing context.
 
void set_clip_rectangle (Geom::OptRect const &rect)
 Apply the clipping rectangle with a NONZERO fill rule.
 
void set_paint_style (StyleMap const &map, SPStyle const *style, SPStyle const *context_style)
 Set the style for drawing shapes from the SVG style, this is all the styles that relate to how vector paths are drawn with stroke, fill and other shape properties.
 
Documentget_document ()
 
std::optional< double > get_softmask (double opacity) const
 

Static Public Member Functions

static Geom::Affine page_transform (SPPage const *page)
 Get the transformation for the given page.
 

Protected Member Functions

void finalize ()
 Finalise the page and add any page properties.
 
- Protected Member Functions inherited from Inkscape::Extension::Internal::PdfBuilder::DrawContext
void set_matrix (Geom::Affine const &affine)
 Set the transformation matrix for this context Group.
 
void transform (Geom::Affine const &affine)
 Add a transform to the current context stream.
 

Private Attributes

Geom::Affine page_tr
 
capypdf::PageProperties page_props
 

Friends

class Document
 

Additional Inherited Members

- Protected Attributes inherited from Inkscape::Extension::Internal::PdfBuilder::DrawContext
capypdf::DrawContext _ctx
 
Document_doc
 

Detailed Description

Definition at line 20 of file build-page.h.

Constructor & Destructor Documentation

◆ PageContext()

Inkscape::Extension::Internal::PdfBuilder::PageContext::PageContext ( Document doc,
SPPage const *  page 
)

Definition at line 34 of file build-page.cpp.

References page, and set_pagebox().

Member Function Documentation

◆ add_anchors_for_page()

void Inkscape::Extension::Internal::PdfBuilder::PageContext::add_anchors_for_page ( SPPage const *  page)

Add any saved anchors (currently cached in the Document) to this page.

  • page - Limit the anchors to the bounds of just this page.

Definition at line 76 of file build-page.cpp.

References Inkscape::Extension::Internal::PdfBuilder::DrawContext::_ctx, Inkscape::Extension::Internal::PdfBuilder::DrawContext::_doc, Inkscape::Extension::Internal::PdfBuilder::Document::get_anchors_for_page(), and page.

◆ annotate()

void Inkscape::Extension::Internal::PdfBuilder::PageContext::annotate ( CapyPDF_AnnotationId  aid)

Add the created annotation to the page.

Definition at line 86 of file build-page.cpp.

References Inkscape::Extension::Internal::PdfBuilder::DrawContext::_ctx.

◆ finalize()

void Inkscape::Extension::Internal::PdfBuilder::PageContext::finalize ( )
protected

Finalise the page and add any page properties.

Definition at line 66 of file build-page.cpp.

References Inkscape::Extension::Internal::PdfBuilder::DrawContext::_ctx, and page_props.

◆ page_transform()

Geom::Affine Inkscape::Extension::Internal::PdfBuilder::PageContext::page_transform ( SPPage const *  page)
static

Get the transformation for the given page.

96 to 72 dpi plus flip y axis (for PDF) plus this page's translation in the SVG document.

Definition at line 23 of file build-page.cpp.

References page, and px2pt.

Referenced by Inkscape::Extension::Internal::PdfBuilder::Document::get_anchors_for_page().

◆ paint_drawing()

void Inkscape::Extension::Internal::PdfBuilder::PageContext::paint_drawing ( CapyPDF_TransparencyGroupId  drawing_id,
Geom::Affine const &  affine 
)

Paint the entire canvas as a transparency group.

Definition at line 58 of file build-page.cpp.

References page_tr, and Inkscape::Extension::Internal::PdfBuilder::DrawContext::paint_group().

◆ set_pagebox()

void Inkscape::Extension::Internal::PdfBuilder::PageContext::set_pagebox ( CapyPDF_Page_Box  type,
Geom::Rect const &  size 
)

Definition at line 41 of file build-page.cpp.

References Geom::are_near(), page_props, page_tr, and Inkscape::size.

Referenced by PageContext().

Friends And Related Symbol Documentation

◆ Document

friend class Document
friend

Definition at line 34 of file build-page.h.

Member Data Documentation

◆ page_props

capypdf::PageProperties Inkscape::Extension::Internal::PdfBuilder::PageContext::page_props
private

Definition at line 40 of file build-page.h.

Referenced by finalize(), and set_pagebox().

◆ page_tr

Geom::Affine Inkscape::Extension::Internal::PdfBuilder::PageContext::page_tr
private

Definition at line 39 of file build-page.h.

Referenced by paint_drawing(), and set_pagebox().


The documentation for this class was generated from the following files: