The PdfViewOptions class has the following properties to set the image width or/and height:
"""
<summary>
Max width of an output image in pixels.
</summary>
"""image_max_width# int"""
<summary>
Max height of an output image in pixels.
</summary>
"""image_max_height# int"""
<summary>
The width of the output image in pixels.
</summary>
"""image_width# int"""
<summary>
The height of an output image in pixels.
</summary>
"""image_height# int
You can set the width and/or height of the output images. Use one of the following methods:
To render a single image, set image_width/image_height options.
To render multiple images, set image_max_width/image_max_height options. If an image exceeds these limits, it is resized proportionally.
Warning
If you set the image_width/image_height options, the image_max_width/image_max_height options are ignored.
To set the image_max_width/image_max_height options, follow these steps:
The following code snippet shows how to set the output image size limits:
withgv.Viewer("sample.jpg")asviewer:# Create a PDF file.viewOptions=gvo.PdfViewOptions()# Specify the maximum width and height.viewOptions.image_max_width=800viewOptions.image_max_height=600viewer.view(viewOptions)
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.