GroupDocs.Viewer also provides the feature to set limits for width/height for the output image. Follow the below steps to achieve this functionality.
If you want to render single image in PDF you can set width/height for the output image.
If you set ImageMaxWidth/ImageMaxHeight options, if the image exceeds one of these limits - it will be resized proportionally.
In PdfViewOptions
have following methods to set single image width/height in PDF.
/**
* Max width of an output image in pixels. (When converting single image to HTML only)
*/publicintgetImageMaxWidth();/**
* Max width of an output image in pixels. (When converting single image to HTML only)
*/publicvoidsetImageMaxWidth(intimageMaxWidth);/**
* Max height of an output image in pixels. (When converting single image to HTML only)
*/publicintgetImageMaxHeight();/**
* Max height of an output image in pixels. (When converting single image to HTML only)
*/publicvoidsetImageMaxHeight(intimageMaxHeight);/**
* The width of the output image in pixels. (When converting single image to HTML only)
*/publicintgetImageWidth();/**
* The width of the output image in pixels. (When converting single image to HTML only)
*/publicvoidsetImageWidth(intimageWidth);/**
* The height of an output image in pixels. (When converting single image to HTML only)
*/publicintgetImageHeight();/**
* The height of an output image in pixels. (When converting single image to HTML only)
*/publicvoidsetImageHeight(intimageHeight);
Note: If you set Width/Height in options, MaxWidth/MaxHeight options will be ignored.
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.