OtgRasterizationOptions Class

Summary: The Otg rasterization options

Module: aspose.imaging.imageoptions

Full Name: aspose.imaging.imageoptions.OtgRasterizationOptions

Inheritance: OdRasterizationOptions

Constructors

NameDescription
OtgRasterizationOptions()Initializes a new instance of the OtgRasterizationOptions class

Properties

NameTypeAccessDescription
background_colorColorr/wGets or sets a background color.
border_xfloatr/wGets or sets the border X.
border_yfloatr/wGets or sets the border Y.
center_drawingboolr/wGets or sets a value indicating whether center drawing.
draw_colorColorr/wGets or sets a foreground color.
page_heightfloatr/wGets or sets the page height.
If the value is 0, the source image aspect ratio will be preserved.
page_sizeSizeFr/wGets or sets the page size.
If one of SizeF dimensions is 0, the source image aspect ratio will be preserved.
page_widthfloatr/wGets or sets the page width.
If the value is 0, the source image aspect ratio will be preserved.
positioningPositioningTypesr/wGets or sets the positioning.
smoothing_modeSmoothingModer/wGets or sets the smoothing mode.
text_rendering_hintTextRenderingHintr/wGets or sets the text rendering hint.

Methods

NameDescription
clone()Creates a new object that is a shallow copy of the current instance.
copy_to(vector_rasterization_options)Copies to.

Constructor: OtgRasterizationOptions()

 OtgRasterizationOptions() 

Initializes a new instance of the OtgRasterizationOptions class

Method: clone()

 clone() 

Creates a new object that is a shallow copy of the current instance.

Returns

TypeDescription
System.ObjectA new object that is a shallow copy of this instance.

Method: copy_to(vector_rasterization_options)

 copy_to(vector_rasterization_options) 

Copies to.

Parameters:

ParameterTypeDescription
vector_rasterization_optionsVectorRasterizationOptionsThe vector rasterization options.

Examples

The following code snippet demonstrates how to convert an OTG image to PDF and other image formats.


from aspose.pycore import cast
from aspose.imaging import Image, SizeF
from aspose.imaging.imageoptions import PngOptions, PdfOptions, OtgRasterizationOptions

dir_: str = "c:\\3567\\"
input_file_path: str = dir_ + "VariousObjectsMultiPage.otg"
options = [PngOptions(), PdfOptions()]
for save_options in options:
	extension: str = ".png" if aspycore.is_assignable(save_options, PngOptions) else ".pdf"
	with Image.load(input_file_path) as image:
		otg_rasterization_options = OtgRasterizationOptions()
		otg_rasterization_options.page_size = cast(SizeF, image.size)
		save_options.vector_rasterization_options = otg_rasterization_options
		image.save(input_file_path + extension, save_options)