GroupDocs.Viewer applies the aspect ratio automatically applied when you set the Width or Height value.
The following code snippet shows how to set the image width or height.
usingGroupDocs.Viewer;usingGroupDocs.Viewer.Options;// ...using(Viewerviewer=newViewer("sample.docx")){// Create a JPG file.JpgViewOptionsviewOptions=newJpgViewOptions();// Specify the width and height.viewOptions.Width=600;viewOptions.Height=800;viewer.View(viewOptions);}
ImportsGroupDocs.ViewerImportsGroupDocs.Viewer.Options' ...
ModuleProgramSubMain(argsAsString())UsingviewerAsViewer=NewViewer("sample.docx")' Create a JPG file.
DimviewOptionsAsJpgViewOptions=NewJpgViewOptions()' Specify the width and height.
viewOptions.Width=600viewOptions.Height=800viewer.View(viewOptions)EndUsingEndSubEndModule
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.