OdgRasterizationOptions Class

Summary: The Odg rasterization options

Module: aspose.imaging.imageoptions

Full Name: aspose.imaging.imageoptions.OdgRasterizationOptions

Inheritance: OdRasterizationOptions

Constructors

NameDescription
OdgRasterizationOptions()Initializes a new instance of the OdgRasterizationOptions 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: OdgRasterizationOptions()

 OdgRasterizationOptions() 

Initializes a new instance of the OdgRasterizationOptions class

Method: clone()

 clone() 

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

Returns

TypeDescription
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 example shows how to export a FODG (Flat XML ODF Template) image to PDF format.

from os.path import join
import aspose.pycore as aspycore
from aspose.imaging import Image, Color, SizeF
from aspose.imaging.fileformats.tiff import TiffImage
from aspose.imaging.imageoptions import OdgRasterizationOptions, PdfOptions

dir_: str = "c:\\aspose.imaging\\issues\\net\\3635"
input_file_name: str = join(dir_, "VariousObjectsMultiPage.fodg")
output_file_name: str = input_file_name + ".pdf"
with Image.load(input_file_name) as image:
	rasterization_options = OdgRasterizationOptions()
	rasterization_options.background_color = Color.white
	rasterization_options.page_size = aspycore.cast(SizeF, image.size)
	save_options = PdfOptions()
	save_options.vector_rasterization_options = rasterization_options
	image.save(output_file_name, save_options)