Poppler CPP 24.12.0
|
#include "poppler/cpp/poppler-renderer.h"
Public Types | |
enum | line_mode_enum { line_default , line_solid , line_shape } |
enum | render_hint { antialiasing = 0x00000001 , text_antialiasing = 0x00000002 , text_hinting = 0x00000004 } |
Public Member Functions | |
page_renderer () | |
~page_renderer () | |
image::format_enum | image_format () const |
line_mode_enum | line_mode () const |
argb | paper_color () const |
unsigned int | render_hints () const |
image | render_page (const page *p, double xres=72.0, double yres=72.0, int x=-1, int y=-1, int w=-1, int h=-1, rotation_enum rotate=rotate_0) const |
void | set_image_format (image::format_enum format) |
void | set_line_mode (line_mode_enum mode) |
void | set_paper_color (argb c) |
void | set_render_hint (render_hint hint, bool on=true) |
void | set_render_hints (unsigned int hints) |
Static Public Member Functions | |
static bool | can_render () |
Simple way to render a page of a PDF document.
A flag of an option taken into account when rendering.
page_renderer::page_renderer | ( | ) |
Constructs a new page renderer.
page_renderer::~page_renderer | ( | ) |
Destructor.
|
static |
Rendering capability test.
page_renderer can render only if a render backend ('Splash') is compiled in Poppler.
image::format_enum page_renderer::image_format | ( | ) | const |
The image format used when rendering.
By default ARGB32 is set.
page_renderer::line_mode_enum page_renderer::line_mode | ( | ) | const |
The line mode used when rendering.
By default default mode is set.
argb page_renderer::paper_color | ( | ) | const |
The color used for the "paper" of the pages.
The default color is opaque solid white (0xffffffff).
unsigned int page_renderer::render_hints | ( | ) | const |
The hints used when rendering.
By default no hint is set.
image page_renderer::render_page | ( | const page * | p, |
double | xres = 72.0 , |
||
double | yres = 72.0 , |
||
int | x = -1 , |
||
int | y = -1 , |
||
int | w = -1 , |
||
int | h = -1 , |
||
rotation_enum | rotate = rotate_0 |
||
) | const |
Render the specified page.
This functions renders the specified page on an image following the specified parameters, returning it.
p | the page to render |
xres | the X resolution, in dot per inch (DPI) |
yres | the Y resolution, in dot per inch (DPI) |
x | the X top-right coordinate, in pixels |
y | the Y top-right coordinate, in pixels |
w | the width in pixels of the area to render |
h | the height in pixels of the area to render |
rotate | the rotation to apply when rendering the page |
void page_renderer::set_image_format | ( | image::format_enum | format | ) |
Set new image format used when rendering.
format | the new image format |
void page_renderer::set_line_mode | ( | page_renderer::line_mode_enum | mode | ) |
Set new line mode used when rendering.
mode | the new line mode |
void page_renderer::set_paper_color | ( | argb | c | ) |
Set a new color for the "paper".
c | the new color |
void page_renderer::set_render_hint | ( | page_renderer::render_hint | hint, |
bool | on = true |
||
) |
Enable or disable a single render hint.
hint | the hint to modify |
on | whether enable it or not |
void page_renderer::set_render_hints | ( | unsigned int | hints | ) |
Set new render hints at once.
hints | the new set of render hints |