The CadOptions class encapsulates various settings and parameters that can be used
to control the rendering of CAD drawings in the GroupDocs.Viewer component.
The scale factor for rendering. Values greater than 1 will enlarge the output result, while values between 0 and 1 will make the output result smaller.
Returns:CadOptions - a new instance of the CadOptions class for rendering by scale factor.
forRenderingByWidth(int width)
public static CadOptions forRenderingByWidth(int width)
Initializes a new instance of the
CadOptions
class for rendering by width.
Returns:CadOptions - a new instance of the CadOptions class for rendering by width and height.
getScaleFactor()
public final double getScaleFactor()
Gets the scale factor for rendering.
Values higher than 1 will enlarge the output result, while values between 0 and 1 will make the output result smaller.
Returns:
double - the scale factor for rendering.
getWidth()
public final int getWidth()
Gets the width of the output result in pixels.
Returns:
int - the width of the output result.
getHeight()
public final int getHeight()
Gets the height of the output result in pixels.
Returns:
int - the height of the output result.
getBackgroundColor()
public Color getBackgroundColor()
Gets the background color of the image.
Returns:
java.awt.Color - the background color of the image.
getBackgroundColorAsHex()
public String getBackgroundColorAsHex()
Gets the background color of the image.
Returns:
java.lang.String - the background color of the image in 0xFFFFFF format.
setBackgroundColor(Color backgroundColor)
public void setBackgroundColor(Color backgroundColor)
Indicates whether layouts from the CAD document should be rendered.
Note: This option applies only to CAD drawings that support layouts, such as FileType.DXF, FileType.DWG, FileType.DWT, FileType.DWF, and FileType.DWFX.
By default, only the Model is rendered.
Returns:
boolean - true if layouts should be rendered, false otherwise.
setRenderLayouts(boolean value)
public final void setRenderLayouts(boolean value)
Sets whether layouts from the CAD document should be rendered.
Note: This option applies only to CAD drawings that support layouts, such as FileType.DXF, FileType.DWG, FileType.DWT, FileType.DWF, and FileType.DWFX.
By default, only the Model is rendered.
Parameters:
Parameter
Type
Description
value
boolean
true to render layouts, false otherwise.
getLayoutName()
public final String getLayoutName()
Gets the name of the specific layout to render. The layout name is case-sensitive.
Note: This option applies only to CAD drawings that support layouts, such as FileType.DXF, FileType.DWG, FileType.DWT, FileType.DWF, and FileType.DWFX.
By default, only the Model is rendered.
Returns:
java.lang.String - the name of the specific layout to render.
setLayoutName(String value)
public final void setLayoutName(String value)
Sets the name of the specific layout to render. The layout name is case-sensitive.
Note: This option applies only to CAD drawings that support layouts, such as FileType.DXF, FileType.DWG, FileType.DWT, FileType.DWF, and FileType.DWFX.
By default, only the Model is rendered.
Parameters:
Parameter
Type
Description
value
java.lang.String
The name of the specific layout to render.
getLayers()
public final List<Layer> getLayers()
Gets the CAD drawing layers to render.
Note: By default, all layers are rendered. Layer names are case-sensitive.
Returns:
java.util.List<com.groupdocs.viewer.results.Layer> - the CAD drawing layers.
setLayers(List value)
public final void setLayers(List<Layer> value)
Gets the CAD drawing layers to render.
Note: By default, all layers are rendered. Layer names are case-sensitive.
public boolean isEnablePerformanceConversionMode()
Setting this flag to true enables a special performance-oriented conversion mode for all formats within the CAD family. In this mode, the conversion speed is much faster, but the quality of the resultant documents is significantly worse. By default, it is disabled (false). The quality of the resultant documents is the best possible at the expense of performance.
Returns:
boolean - true if performance-oriented conversion mode is enabled, false otherwise.
public void setEnablePerformanceConversionMode(boolean enablePerformanceConversionMode)
Setting this flag to true enables a special performance-oriented conversion mode for all formats within the CAD family. In this mode, the conversion speed is much faster, but the quality of the resultant documents is significantly worse. By default, it is disabled (false). The quality of the resultant documents is the best possible at the expense of performance.
Parameters:
Parameter
Type
Description
enablePerformanceConversionMode
boolean
true to enable the performance-oriented conversion mode, false to disable it.
equals(Object o)
public boolean equals(Object o)
Checks if this CadOptions object is equal to another object.
Parameters:
Parameter
Type
Description
o
java.lang.Object
The object to compare with.
Returns:
boolean - true if the objects are equal, false otherwise.
hashCode()
public int hashCode()
Computes the hash code value for this object. The hash code is based on
the internal state of the object and is used in hash-based data structures
such as hash maps and hash sets.
Note: This method overrides the default implementation of the hashCode() method defined in the Object class.
Returns:
int - the hash code value for this object.
toString()
public String toString()
Returns a string representation of this object.
Note: This method overrides the default implementation of the toString() method defined in the Object class.
Returns:
java.lang.String - a string representation of this object.
toString(ToStringStyle style)
public String toString(ToStringStyle style)
Returns a string representation of this object.
Note: This method overrides the default implementation of the toString() method defined in the Object class.
Parameters:
Parameter
Type
Description
style
org.apache.commons.lang3.builder.ToStringStyle
The ToStringStyle to use for generating the string representation.
Returns:
java.lang.String - a string representation of this object using the specified ToStringStyle.
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.