Skip to content

Commit

Permalink
rendering: order parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
mara004 committed Aug 30, 2022
1 parent b49681e commit 48f875a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions src/pypdfium2/_cli/render.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,19 +184,19 @@ def main(args):

kwargs = dict(
page_indices = page_indices,
n_processes = args.processes,
scale = args.scale,
rotation = args.rotation,
crop = args.crop,
greyscale = args.greyscale,
color = args.background_color,
color_scheme = color_scheme,
fill_to_stroke = args.fill_to_stroke,
force_halftone = args.force_halftone,
greyscale = args.greyscale,
optimise_mode = args.optimise_mode,
draw_annots = not args.no_annotations,
draw_forms = not args.no_forms,
force_halftone = args.force_halftone,
rev_byteorder = args.rev_byteorder,
n_processes = args.processes,
)
for type in args.no_antialias:
kwargs["no_smooth%s" % type] = True
Expand Down
6 changes: 3 additions & 3 deletions src/pypdfium2/_helpers/document.py
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ def render_tobytes(self, **kwargs):
See :meth:`.PdfDocument._render_base` and :meth:`.PdfPage.render_base` for possible keyword arguments.
Yields:
:class:`tuple`: Result of :meth:`.PdfPage.render_tobytes`.
Result of :meth:`.PdfPage.render_tobytes`.
"""
yield from self._render_base("bytes", **kwargs)

Expand All @@ -472,7 +472,7 @@ def render_topil(self, **kwargs):
See :meth:`.PdfDocument._render_base` and :meth:`.PdfPage.render_base` for possible keyword arguments.
Yields:
:class:`PIL.Image.Image`: PIL image.
Result of :meth:`.PdfPage.render_topil`.
"""
yield from self._render_base("pil", **kwargs)

Expand All @@ -484,7 +484,7 @@ def render_tonumpy(self, **kwargs):
See :meth:`.PdfDocument._render_base` and :meth:`.PdfPage.render_base` for possible keyword arguments.
Yields:
(:class:`numpy.ndarray`, str): NumPy array, and color format.
Result of :meth:`.PdfPage.render_tonumpy`.
"""
yield from self._render_base("numpy", **kwargs)

Expand Down
6 changes: 3 additions & 3 deletions src/pypdfium2/_helpers/page.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,9 @@ def render_base(
Amount in PDF canvas units to cut off from page borders (left, bottom, right, top).
Crop is applied after rotation.
greyscale (bool):
Whether to render in greyscale mode (no colors).
color (typing.Tuple[int, int, int, int]):
Page background color. Shall be a list of values for red, green, blue and alpha, ranging from 0 to 255.
For RGB, 0 will include nothing of the color in question, while 255 will fully include it.
Expand All @@ -303,9 +306,6 @@ def render_base(
fill_to_stroke (bool):
Whether fill paths need to be stroked. This option is ignored if *color_scheme* is :data:`None`.
greyscale (bool):
Whether to render in greyscale mode (no colors).
optimise_mode (OptimiseMode):
How to optimise page rendering.
Expand Down

0 comments on commit 48f875a

Please sign in to comment.