Merge "Use the PDF cropbox for rendering"

This commit is contained in:
jenkins-bot 2022-08-05 17:45:19 +00:00 committed by Gerrit Code Review
commit 7a14e5509d
2 changed files with 6 additions and 0 deletions

View file

@ -217,6 +217,8 @@ class PdfHandler extends ImageHandler {
"-dLastPage={$page}",
"-dSAFER",
"-r{$wgPdfHandlerDpi}",
// CropBox defines the region that the PDF viewer application is expected to display or print.
"-dUseCropBox",
"-dBATCH",
"-dNOPAUSE",
"-q",

View file

@ -24,6 +24,10 @@ runInfo() {
}
runToText() {
# CropBox defines the region that the PDF viewer application is expected to display or print.
# pdftotext's -cropbox was only introduced in poppler 21.03.0
# It also only works with -bbox so we cannot use it.
# Some text that is not visible in the PDF might thus be included in the output
"$PDFHANDLER_TOTEXT" \
file.pdf - > text
# Store exit code so we can use it later