Currently, we’re creating PNG images from DWF images by using this sample source.
However, it’s automatically reduced.
Our purpose is to output images without automatically reduction, but the images is out of print area and not displayed.
We want sample source for setting the drawing position without automatic reduction.
rasterizationOptions.NoScaling = True
rasterizationOptions.AutomaticLayoutsScaling = False
Private Sub convertPNG(ByVal dwfFilePath As String, ByVal pngFilePath As String)
Using image As Aspose.CAD.Image = Aspose.CAD.Image.Load(dwfFilePath)
Dim rasterizationOptions = New Aspose.CAD.ImageOptions.CadRasterizationOptions()
rasterizationOptions.PageSize = New SizeF(image.Size.Width * 8 + 16, image.Size.Height * 8 + 16)
rasterizationOptions.DrawType = CadDrawTypeMode.UseObjectColor
rasterizationOptions.NoScaling = True
rasterizationOptions.AutomaticLayoutsScaling = False
rasterizationOptions.BackgroundColor = Aspose.CAD.Color.Transparent
rasterizationOptions.EmbedBackground = False
rasterizationOptions.Zoom = 1
Dim margins = New Margins()
margins.Right = 1
rasterizationOptions.Margins = margins
rasterizationOptions.GraphicsOptions.SmoothingMode = Aspose.CAD.SmoothingMode.HighQuality
rasterizationOptions.GraphicsOptions.TextRenderingHint = Aspose.CAD.TextRenderingHint.AntiAliasGridFit
rasterizationOptions.GraphicsOptions.InterpolationMode = Aspose.CAD.InterpolationMode.HighQualityBicubic
Dim iob = New Aspose.CAD.ImageOptions.PngOptions()
iob.VectorRasterizationOptions = rasterizationOptions
iob.ColorType = Aspose.CAD.FileFormats.Png.PngColorType.TruecolorWithAlpha
image.Save(pngFilePath, iob)
End Using
End Sub