com.groupdocs.viewer.options

Class CadOptions



  • public class CadOptions
    extends Object

    Provides options for rendering CAD drawings.

    • Method Detail

      • forRenderingByHeight

        public static CadOptions forRenderingByHeight(int height)

        Initializes new instance of CadOptions class for rendering by height.

        Parameters:
        height - The height of the output result in pixels.
        Returns:
        New instance of CadOptions class for rendering by height.
        Throws:
        IllegalArgumentException - Thrown when height is less or equal to zero.
      • forRenderingByScaleFactor

        public static CadOptions forRenderingByScaleFactor(float scaleFactor)

        Initializes new instance of CadOptions class for rendering by scale factor.

        Parameters:
        scaleFactor - Values higher than 1 will enlarge output result; values between 0 and 1 will make output result smaller.
        Returns:
        New instance of CadOptions class for rendering by scale factor.
      • forRenderingByWidth

        public static CadOptions forRenderingByWidth(int width)

        Initializes new instance of CadOptions class for rendering by width.

        Parameters:
        width - The width of the output result in pixels.
        Returns:
        New instance of CadOptions class for rendering by width.
        Throws:
        IllegalArgumentException - Thrown when width is less or equal to zero.
      • forRenderingByWidthAndHeight

        public static CadOptions forRenderingByWidthAndHeight(int width,
                                              int height)

        Initializes new instance of CadOptions class for rendering by width and height.

        Parameters:
        width - The width of the output result in pixels.
        height - The height of the output result in pixels.
        Returns:
        New instance of CadOptions class for rendering by width and height.
        Throws:
        IllegalArgumentException - Thrown when width is less or equal to zero.
        IllegalArgumentException - Thrown when height is less or equal to zero.
      • getBackgroundColor

        public Color getBackgroundColor()
        Gets image background color
        Returns:
        Image background color
      • getHeight

        public final int getHeight()

        The height of the output result in pixels.

      • getLayers

        public final List<Layer> getLayers()

        The CAD drawing layers to render.


        By default all layers are rendered; Layer names are case-sensitive.
      • getPc3File

        public String getPc3File()
        PC3 - plotter configuration file
      • getScaleFactor

        public final float getScaleFactor()

        Values higher than 1 will enlarge output result; values between 0 and 1 will make output result smaller.

      • getWidth

        public final int getWidth()

        The width of the output result in pixels.

      • setBackgroundColor

        public void setBackgroundColor(Color mBackgroundColor)
        Sets image background color
        Parameters:
        mBackgroundColor - Image background color
      • setLayers

        public final void setLayers(List<Layer> value)

        The CAD drawing layers to render.


        By default all layers are rendered; Layer names are case-sensitive.
      • setPc3File

        public void setPc3File(String pc3File)
        PC3 - plotter configuration file
      • setRenderLayouts

        public final void setRenderLayouts(boolean value)

        Indicates whether layouts from CAD document should be rendered.


        This option applies only to CAD drawings that support layouts FileType.DXF, FileType.DWG, FileType.DWT, FileType.DWF and FileType.DWFX; By default only Model is rendered.