Plugins must return not-None if they intend to stop builtin
This commit is contained in:
@@ -78,7 +78,7 @@ def rasterize_pdf_page(
|
||||
rotation=None,
|
||||
filter_vector=False,
|
||||
):
|
||||
return ghostscript.rasterize_pdf(
|
||||
ghostscript.rasterize_pdf(
|
||||
input_file,
|
||||
output_file,
|
||||
raster_device=raster_device,
|
||||
@@ -88,14 +88,16 @@ def rasterize_pdf_page(
|
||||
rotation=rotation,
|
||||
filter_vector=filter_vector,
|
||||
)
|
||||
return output_file
|
||||
|
||||
|
||||
@hookimpl
|
||||
def generate_pdfa(pdf_pages, pdfmark, output_file, compression, pdf_version, pdfa_part):
|
||||
return ghostscript.generate_pdfa(
|
||||
ghostscript.generate_pdfa(
|
||||
pdf_pages=[*pdf_pages, pdfmark],
|
||||
output_file=output_file,
|
||||
compression=compression,
|
||||
pdf_version=pdf_version,
|
||||
pdfa_part=pdfa_part,
|
||||
)
|
||||
return output_file
|
||||
|
||||
@@ -78,7 +78,7 @@ def rasterize_pdf_page(
|
||||
page_dpi: Optional[Resolution] = None,
|
||||
rotation: Optional[int] = None,
|
||||
filter_vector: bool = False,
|
||||
) -> None:
|
||||
) -> Path:
|
||||
"""Rasterize one page of a PDF at resolution raster_dpi in canvas units.
|
||||
|
||||
The image is sized to match the integer pixels dimensions implied by
|
||||
@@ -93,7 +93,7 @@ def rasterize_pdf_page(
|
||||
rotation: cardinal angle, clockwise, to rotate page
|
||||
filter_vector: if True, remove vector graphics objects
|
||||
Returns:
|
||||
None
|
||||
output_file
|
||||
"""
|
||||
|
||||
|
||||
@@ -172,7 +172,7 @@ def generate_pdfa(
|
||||
compression: str,
|
||||
pdf_version: str,
|
||||
pdfa_part: str,
|
||||
):
|
||||
) -> Path:
|
||||
"""Generate a PDF/A.
|
||||
|
||||
The pdf_pages, a list of files, will be merged into output_file. One or more
|
||||
@@ -189,4 +189,7 @@ def generate_pdfa(
|
||||
support passthrough JPEG which allows Ghostscript to avoid transcoding
|
||||
images entirely. (The feature was added in 9.23 but broken, and the 9.24
|
||||
release of Ghostscript had regressions, so we don't support it until 9.25.)
|
||||
|
||||
Returns:
|
||||
output_file
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user