mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/PdfHandler
synced 2024-11-11 17:08:08 +00:00
Merge "Use the PDF cropbox for rendering"
This commit is contained in:
commit
7a14e5509d
|
@ -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",
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue