poppler::page_renderer Class Reference

Simple way to render a page of a PDF document. More...

#include "poppler/cpp/poppler-renderer.h"

Inheritance diagram for poppler::page_renderer:
[legend]

List of all members.

Public Types

enum  render_hint {
  antialiasing = 0x00000001,
  text_antialiasing = 0x00000002,
  text_hinting = 0x00000004
}

Public Member Functions

 page_renderer ()
 ~page_renderer ()
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_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 ()

Detailed Description

Simple way to render a page of a PDF document.

Since:
0.16

Member Enumeration Documentation

A flag of an option taken into account when rendering.


Constructor & Destructor Documentation

page_renderer::page_renderer (  ) 

Constructs a new page renderer.

page_renderer::~page_renderer (  ) 

Destructor.


Member Function Documentation

bool page_renderer::can_render (  )  [static]

Rendering capability test.

page_renderer can render only if a render backend ('Splash') is compiled in Poppler.

Returns:
whether page_renderer can render
argb page_renderer::paper_color (  )  const

The color used for the "paper" of the pages.

The default color is opaque solid white (0xffffffff).

Returns:
the paper color
unsigned int page_renderer::render_hints (  )  const

The hints used when rendering.

By default no hint is set.

Returns:
the render hints 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.

Parameters:
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
Returns:
the rendered image, or a null one in case of errors
See also:
can_render
void page_renderer::set_paper_color ( argb  c  ) 

Set a new color for the "paper".

Parameters:
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.

Parameters:
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.

Parameters:
hints the new set of render hints

Generated on 27 Dec 2015 for Poppler CPP by  doxygen 1.6.1