Allow PDF density adjustment

Created on 3 March 2023, over 1 year ago
Updated 18 June 2024, 5 months ago

Problem/Motivation

Before converting a PDF to JPG/PNG, ImageMagick must render it.

The rendering, by default, is done at 72 DPI. While this is acceptable for a thumbnail, this can lead to a poor quality preview (even with quality set at 100%).

Proposed resolution

The attached patch allows to globally specify the resolution used for rendering (aka the "-density" parameter of ImageMagick). It defaults to 72 DPI in order to have no impact on existing configurations and can be set up to 1200 DPI (300 DPI works very well).

Remaining tasks

  • Determining if the proposed solution fits into the PDFPreview project
  • Reviewing code of the proposed patch

User interface changes

A "Resolution used for rendering" field is added to the admin/config/media/pdfpreview page.

Data model changes

An integer field named "density" is added to the schema.

Feature request
Status

Active

Version

2.0

Component

Code

Created by

🇫🇷France Zigazou

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024