CadRasterizationOptions

Inheritance: java.lang.Object, VectorRasterizationOptions

All Implemented Interfaces: com.aspose.cad_internal.imageoptions.IRasterRenderingOptions

The Cad rasterization options.

Constructors

ConstructorDescription
CadRasterizationOptions()

Fields

FieldDescription
RenderResultRendering result handler. Sets up error handler to catch all export errors and prints them to STDOUT using (var image = Aspose.CAD.Image.Load(“fileName.dwg”)) { image.Save(“targetFile.bmp”, new BmpOptions() { VectorRasterizationOptions = new CadRasterizationOptions() { RenderResult = result => { if (!result.IsRenderComplete) { foreach (var resultFailure in result.Failures) { Console.WriteLine($“Error: {resultFailure.Message} (error code {resultFailure.RenderCode})”); } } } } }); }

Methods

MethodDescription
getZoom()Gets or sets zoom factor. Allows to zoom drawing relatively to canvas size. Value of 1 corresponds to exact fit, value below 1 allows to preserve margins, value above 1 allows to scale drawing up. Sets up zoom to keep whole drawing borders visible using (CadImage cadImage = (CadImage)Image.Load(GetPath(fileName))) { JpegOptions options = new JpegOptions(); var rasterizationOptions = new CadRasterizationOptions(); rasterizationOptions.Zoom = 0.9f; options.VectorRasterizationOptions = rasterizationOptions; cadImage.Save(outFile, options); }
setZoom(float value)Gets or sets zoom factor. Allows to zoom drawing relatively to canvas size. Value of 1 corresponds to exact fit, value below 1 allows to preserve margins, value above 1 allows to scale drawing up. Sets up zoom to keep whole drawing borders visible using (CadImage cadImage = (CadImage)Image.Load(GetPath(fileName))) { JpegOptions options = new JpegOptions(); var rasterizationOptions = new CadRasterizationOptions(); rasterizationOptions.Zoom = 0.9f; options.VectorRasterizationOptions = rasterizationOptions; cadImage.Save(outFile, options); }
getPenOptions()Gets or sets the pen options. Sets up “squared” pen using (CadImage cadImage = (CadImage)Image.Load(GetPath(fileName))) { JpegOptions options = new JpegOptions(); var rasterizationOptions = new CadRasterizationOptions(); rasterizationOptions.PenOptions = new PenOptions() { StartCap = LineCap.Square, EndCap = LineCap.Square }; options.VectorRasterizationOptions = rasterizationOptions; cadImage.Save(outFile, options); }
setPenOptions(PenOptions value)Gets or sets the pen options. Sets up “squared” pen using (CadImage cadImage = (CadImage)Image.Load(GetPath(fileName))) { JpegOptions options = new JpegOptions(); var rasterizationOptions = new CadRasterizationOptions(); rasterizationOptions.PenOptions = new PenOptions() { StartCap = LineCap.Square, EndCap = LineCap.Square }; options.VectorRasterizationOptions = rasterizationOptions; cadImage.Save(outFile, options); }
getObserverPoint()Gets or sets the observer point. Sets up observation point to perform export of custom view of a drawing using (CadImage cadImage = (CadImage)Image.Load(GetPath(fileName))) { JpegOptions options = new JpegOptions(); var rasterizationOptions = new CadRasterizationOptions(); rasterizationOptions.PageWidth = 1500; rasterizationOptions.PageHeight = 1500; float xAngle = 10; //Angle of rotation along the X axis float yAngle = 20; //Angle of rotation along the Y axis float zAngle = 30; //Angle of rotation along the Z axis rasterizationOptions.ObserverPoint = new ObserverPoint(xAngle, yAngle, zAngle); options.VectorRasterizationOptions = rasterizationOptions; cadImage.Save(outFile, options); }
setObserverPoint(ObserverPoint value)Gets or sets the observer point. Sets up observation point to perform export of custom view of a drawing using (CadImage cadImage = (CadImage)Image.Load(GetPath(fileName))) { JpegOptions options = new JpegOptions(); var rasterizationOptions = new CadRasterizationOptions(); rasterizationOptions.PageWidth = 1500; rasterizationOptions.PageHeight = 1500; float xAngle = 10; //Angle of rotation along the X axis float yAngle = 20; //Angle of rotation along the Y axis float zAngle = 30; //Angle of rotation along the Z axis rasterizationOptions.ObserverPoint = new ObserverPoint(xAngle, yAngle, zAngle); options.VectorRasterizationOptions = rasterizationOptions; cadImage.Save(outFile, options); }
getAutomaticLayoutsScaling()Gets or sets a value indicating whether layouts should be automatically scaled.
setAutomaticLayoutsScaling(boolean value)Gets or sets a value indicating whether layouts should be automatically scaled.
getLayers()Gets or sets layers of DXF file to export.
setLayers(List value)Gets or sets layers of DXF file to export.
getLayouts()Gets or sets the layoutName.
setLayouts(String[] value)Gets or sets the layoutName.
getDrawType()Gets or sets type of drawing.
setDrawType(int value)Gets or sets type of drawing.
getScaleMethod()Gets or sets scale method for automatic adjust of image size.
setScaleMethod(int value)Gets or sets scale method for automatic adjust of image size.
isNoScaling()Gets or sets no scaling during export.
setNoScaling(boolean value)Gets or sets no scaling during export.
getPdfProductLocation()The PDF product location
setPdfProductLocation(String value)The PDF product location
getQuality()Gets or sets the quality.
setQuality(RasterizationQuality value)Gets or sets the quality.
getExportAllLayoutContent()Gets or sets whether to export entities on layouts, which are outside plot area.
setExportAllLayoutContent(boolean value)Gets or sets whether to export entities on layouts, which are outside plot area.
getShxFonts()Gets or sets paths to SHX fonts to be used at export.
setShxFonts(String[] value)Gets or sets paths to SHX fonts to be used at export.
getCtbSources()Gets or sets the CTB sources. Value: The CTB sources.
setCtbSources(Map<String,InputStream> map)Gets or sets the CTB sources. Value: The CTB sources.

CadRasterizationOptions()

public CadRasterizationOptions()

RenderResult

public CadRasterizationOptions.CadRenderHandler RenderResult

Rendering result handler. Sets up error handler to catch all export errors and prints them to STDOUT using (var image = Aspose.CAD.Image.Load(“fileName.dwg”)) { image.Save(“targetFile.bmp”, new BmpOptions() { VectorRasterizationOptions = new CadRasterizationOptions() { RenderResult = result => { if (!result.IsRenderComplete) { foreach (var resultFailure in result.Failures) { Console.WriteLine($“Error: {resultFailure.Message} (error code {resultFailure.RenderCode})”); } } } } }); }

Returns: CadRasterizationOptions.CadRenderHandler

getZoom()

public float getZoom()

Gets or sets zoom factor. Allows to zoom drawing relatively to canvas size. Value of 1 corresponds to exact fit, value below 1 allows to preserve margins, value above 1 allows to scale drawing up. Sets up zoom to keep whole drawing borders visible using (CadImage cadImage = (CadImage)Image.Load(GetPath(fileName))) { JpegOptions options = new JpegOptions(); var rasterizationOptions = new CadRasterizationOptions(); rasterizationOptions.Zoom = 0.9f; options.VectorRasterizationOptions = rasterizationOptions; cadImage.Save(outFile, options); }

Returns: float

setZoom(float value)

public void setZoom(float value)

Gets or sets zoom factor. Allows to zoom drawing relatively to canvas size. Value of 1 corresponds to exact fit, value below 1 allows to preserve margins, value above 1 allows to scale drawing up. Sets up zoom to keep whole drawing borders visible using (CadImage cadImage = (CadImage)Image.Load(GetPath(fileName))) { JpegOptions options = new JpegOptions(); var rasterizationOptions = new CadRasterizationOptions(); rasterizationOptions.Zoom = 0.9f; options.VectorRasterizationOptions = rasterizationOptions; cadImage.Save(outFile, options); }

getPenOptions()

public PenOptions getPenOptions()

Gets or sets the pen options. Sets up “squared” pen using (CadImage cadImage = (CadImage)Image.Load(GetPath(fileName))) { JpegOptions options = new JpegOptions(); var rasterizationOptions = new CadRasterizationOptions(); rasterizationOptions.PenOptions = new PenOptions() { StartCap = LineCap.Square, EndCap = LineCap.Square }; options.VectorRasterizationOptions = rasterizationOptions; cadImage.Save(outFile, options); }

Returns: PenOptions - The pen options.

setPenOptions(PenOptions value)

public void setPenOptions(PenOptions value)

Gets or sets the pen options. Sets up “squared” pen using (CadImage cadImage = (CadImage)Image.Load(GetPath(fileName))) { JpegOptions options = new JpegOptions(); var rasterizationOptions = new CadRasterizationOptions(); rasterizationOptions.PenOptions = new PenOptions() { StartCap = LineCap.Square, EndCap = LineCap.Square }; options.VectorRasterizationOptions = rasterizationOptions; cadImage.Save(outFile, options); }

Parameters:

ParameterTypeDescription
valuePenOptionsThe pen options.

getObserverPoint()

public ObserverPoint getObserverPoint()

Gets or sets the observer point. Sets up observation point to perform export of custom view of a drawing using (CadImage cadImage = (CadImage)Image.Load(GetPath(fileName))) { JpegOptions options = new JpegOptions(); var rasterizationOptions = new CadRasterizationOptions(); rasterizationOptions.PageWidth = 1500; rasterizationOptions.PageHeight = 1500; float xAngle = 10; //Angle of rotation along the X axis float yAngle = 20; //Angle of rotation along the Y axis float zAngle = 30; //Angle of rotation along the Z axis rasterizationOptions.ObserverPoint = new ObserverPoint(xAngle, yAngle, zAngle); options.VectorRasterizationOptions = rasterizationOptions; cadImage.Save(outFile, options); }

Returns: ObserverPoint - The observer point.

setObserverPoint(ObserverPoint value)

public void setObserverPoint(ObserverPoint value)

Gets or sets the observer point. Sets up observation point to perform export of custom view of a drawing using (CadImage cadImage = (CadImage)Image.Load(GetPath(fileName))) { JpegOptions options = new JpegOptions(); var rasterizationOptions = new CadRasterizationOptions(); rasterizationOptions.PageWidth = 1500; rasterizationOptions.PageHeight = 1500; float xAngle = 10; //Angle of rotation along the X axis float yAngle = 20; //Angle of rotation along the Y axis float zAngle = 30; //Angle of rotation along the Z axis rasterizationOptions.ObserverPoint = new ObserverPoint(xAngle, yAngle, zAngle); options.VectorRasterizationOptions = rasterizationOptions; cadImage.Save(outFile, options); }

Parameters:

ParameterTypeDescription
valueObserverPointThe observer point.

getAutomaticLayoutsScaling()

public boolean getAutomaticLayoutsScaling()

Gets or sets a value indicating whether layouts should be automatically scaled.

Returns: boolean

setAutomaticLayoutsScaling(boolean value)

public void setAutomaticLayoutsScaling(boolean value)

Gets or sets a value indicating whether layouts should be automatically scaled.

getLayers()

public List<String> getLayers()

Gets or sets layers of DXF file to export.

Returns: List

setLayers(List value)

public void setLayers(List<String> value)

Gets or sets layers of DXF file to export.

getLayouts()

public String[] getLayouts()

Gets or sets the layoutName.

Returns: String[] - The specific layout name or null for use Model. Model is also a layout.

setLayouts(String[] value)

public void setLayouts(String[] value)

Gets or sets the layoutName.

Parameters:

ParameterTypeDescription
valueString[]The specific layout name or null for use Model. Model is also a layout.

getDrawType()

public int getDrawType()

Gets or sets type of drawing.

Returns: int

setDrawType(int value)

public void setDrawType(int value)

Gets or sets type of drawing.

getScaleMethod()

public int getScaleMethod()

Gets or sets scale method for automatic adjust of image size.

Returns: int

setScaleMethod(int value)

public void setScaleMethod(int value)

Gets or sets scale method for automatic adjust of image size.

isNoScaling()

public boolean isNoScaling()

Gets or sets no scaling during export.

Returns: boolean

setNoScaling(boolean value)

public void setNoScaling(boolean value)

Gets or sets no scaling during export.

getPdfProductLocation()

public String getPdfProductLocation()

The PDF product location

Returns: String

setPdfProductLocation(String value)

public void setPdfProductLocation(String value)

The PDF product location

getQuality()

public final RasterizationQuality getQuality()

Gets or sets the quality.

Returns: RasterizationQuality - The quality.

setQuality(RasterizationQuality value)

public final void setQuality(RasterizationQuality value)

Gets or sets the quality.

Parameters:

ParameterTypeDescription
valueRasterizationQualityThe quality.

getExportAllLayoutContent()

public final boolean getExportAllLayoutContent()

Gets or sets whether to export entities on layouts, which are outside plot area.

Returns: boolean

setExportAllLayoutContent(boolean value)

public final void setExportAllLayoutContent(boolean value)

Gets or sets whether to export entities on layouts, which are outside plot area.

getShxFonts()

public final String[] getShxFonts()

Gets or sets paths to SHX fonts to be used at export.

Returns: String[]

setShxFonts(String[] value)

public final void setShxFonts(String[] value)

Gets or sets paths to SHX fonts to be used at export.

getCtbSources()

public final Map<String,InputStream> getCtbSources()

Gets or sets the CTB sources. Value: The CTB sources.

Returns: Map<String,InputStream>

setCtbSources(Map<String,InputStream> map)

public final void setCtbSources(Map<String,InputStream> map)

Gets or sets the CTB sources. Value: The CTB sources.