for_rendering_by_width method
Leave feedback
On this page
Initializes an instance of the CadOptions class for rendering by width.
def for_rendering_by_width(cls, width):
...
| Parameter | Type | Description |
|---|---|---|
| width | int |
The width of the output result (in pixels). |
Returns: CadOptions: New instance of the CadOptions class for rendering by width.
| Raises | Description |
|---|---|
ValueError |
If width is less than or equal to zero. |
from groupdocs.viewer import Viewer
from groupdocs.viewer.options import HtmlViewOptions, CadOptions
def enable_performance_mode():
# Load CAD file
with Viewer("sample.dwg") as viewer:
view_options = HtmlViewOptions.for_embedded_resources(
"enable_performance_mode/Output-Page#{0}.html"
)
view_options.cad_options = CadOptions.for_rendering_by_width(1000)
view_options.cad_options.enable_performance_conversion_mode = True
viewer.view(view_options)
if __name__ == "__main__":
enable_performance_mode()
- class
CadOptions
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.