Skip to content

glib: Add poppler_page_set_render_antialias(PopplerPage*, cairo_antialias_t)

The pdftocairo command-line tool has an -antialias option that configures the anti-aliasing mode used when rasterizing text and shapes (for example when the output is PNG). This is based on calling the internal CairoOutputDev::setAntialias method.

In the glib API, poppler_page_render is also based on CairoOutputDev but there is no call to setAntialias so CAIRO_ANTIALIAS_DEFAULT (set in CairoOutputDev’s constructor) is always used regardless of how the cairo context was configured before being passed to poppler_page_render.

This fills the gap by keeping an antialiasing mode in each PopplerPage object, adding a setter for it, and calling CairoOutputDev::setAntialias in each rendering function.

Edited by Albert Astals Cid

Merge request reports