mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/PdfHandler
synced 2024-11-13 18:37: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}",
|
"-dLastPage={$page}",
|
||||||
"-dSAFER",
|
"-dSAFER",
|
||||||
"-r{$wgPdfHandlerDpi}",
|
"-r{$wgPdfHandlerDpi}",
|
||||||
|
// CropBox defines the region that the PDF viewer application is expected to display or print.
|
||||||
|
"-dUseCropBox",
|
||||||
"-dBATCH",
|
"-dBATCH",
|
||||||
"-dNOPAUSE",
|
"-dNOPAUSE",
|
||||||
"-q",
|
"-q",
|
||||||
|
|
|
@ -24,6 +24,10 @@ runInfo() {
|
||||||
}
|
}
|
||||||
|
|
||||||
runToText() {
|
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" \
|
"$PDFHANDLER_TOTEXT" \
|
||||||
file.pdf - > text
|
file.pdf - > text
|
||||||
# Store exit code so we can use it later
|
# Store exit code so we can use it later
|
||||||
|
|
Loading…
Reference in a new issue