The following code snippet shows how to set the output image size limits:
fromgroupdocs.viewerimportViewerfromgroupdocs.viewer.optionsimportPdfViewOptionsdefset_image_size_limits():# Load documentwithViewer("sample.jpg")asviewer:# Create a PDF file.viewOptions=PdfViewOptions("set_image_size_limits/image_with_size_limits.pdf")# Specify the maximum width and height.viewOptions.image_max_width=800viewOptions.image_max_height=600viewer.view(viewOptions)if__name__=="__main__":set_image_size_limits()
sample.jpg is the sample file used in this example. Click here to download it.