com.groupdocs.viewer.converter.options

Class CadOptions



  • public class CadOptions
    extends Object

    The CAD documents rendering options.

    • Constructor Detail

      • CadOptions

        public CadOptions()

        Initializes a new instance of the CadOptions class.

    • Method Detail

      • getHeight

        public int getHeight()

        The height of the render result in pixels.

        Returns:
        a int. The following example demonstrates how to set output image height in pixels.
        ViewerImageHandler imageHandler = new ViewerImageHandler();
          ImageOptions options = new ImageOptions();
          options.getCadOptions().setHeight(750);
          String guid = "document.dwg";
          List<PageImage> pages = imageHandler.getPages(guid, options);
          

      • getLayoutName

        public String getLayoutName()

        The name of the specific layout to render.

        Returns:
        a String object. The following example demonstrates how to render specific layout from dwg drawing.
        ViewerImageHandler imageHandler = new ViewerImageHandler();
          ImageOptions options = new ImageOptions();
          options.getCadOptions().setLayoutName("layout1");
          String guid = "multilayout.dwg";
          List<PageImage> pages = imageHandler.getPages(guid, options);
          


        This property is case-insensitive.

      • getRenderLayouts

        public boolean getRenderLayouts()

        Indicates whether layouts from CAD document should be rendered. Default value is false. When render layouts enabled, Model and all non-empty layouts contained in the CAD document will be rendered. Otherwise only Model is rendered.

        Returns:
        a boolean.


          The following example demonstrates how to render layouts from dwg drawing.
          
        ViewerHtmlHandler htmlHandler = new ViewerHtmlHandler();
          HtmlOptions options = new HtmlOptions();
          options.getCadOptions().setRenderLayouts(true);
          String guid = "multilayout.dwg";
          List<PageHtml> pages = htmlHandler.getPages(guid, options);
          


        This option applies only to CAD formats, that support layouts, like dxf and dwg.
      • getScaleFactor

        public float getScaleFactor()

        The scale factor affects the size of an output document.

        Returns:
        a float. The following example demonstrates how to set the scale factor while rendering into HTML.
        ViewerHtmlHandler htmlHandler = new ViewerHtmlHandler();
          HtmlOptions options = new HtmlOptions();
          options.getCadOptions().setScaleFactor(1.5f);
          String guid = "document.dwg";
          List<PageHtml> pages = htmlHandler.getPages(guid, options);
          


        Values higher than 1 will enlarge and values between 0 and 1 will make render result smaller. This property is ignored when either Height or Width properties are set.

      • getTiles

        public List<Tile> getTiles()
      • getWidth

        public int getWidth()

        The width of the render result in pixels.

        Returns:
        a int. The following example demonstrates how to set output image width in pixels.
        ViewerImageHandler imageHandler = new ViewerImageHandler();
          ImageOptions options = new ImageOptions();
          options.getCadOptions().setWidth(850);
          String guid = "document.dwg";
          List<PageImage> pages = imageHandler.getPages(guid, options);
          

      • setHeight

        public void setHeight(int value)

        The height of the render result in pixels.

        Parameters:
        value - a int.
      • setLayers

        public void setLayers(List<String> value)
      • setLayoutName

        public void setLayoutName(String value)

        The name of the specific layout to render.

        Parameters:
        value - a String object.
      • setRenderLayouts

        public void setRenderLayouts(boolean value)

        Indicates whether layouts from CAD document should be rendered. Default value is false. When render layouts enabled, Model and all non-empty layouts contained in the CAD document will be rendered. Otherwise only Model is rendered.

        Parameters:
        value - a boolean.
      • setScaleFactor

        public void setScaleFactor(float value)

        The scale factor affects the size of an output document.

        Parameters:
        value - a float.
      • setTiles

        public void setTiles(List<Tile> value)
      • setWidth

        public void setWidth(int value)

        The width of the render result in pixels.

        Parameters:
        value - a int.