Quality of pdf with aspose.cad for python

I have been trying the aspose-cad python library from pypi to test conversion of DWF files to PDF files. The sample script from the Aspose website seems to work ok, but the quality is very poor and I need high resolution / vectorized PDF for ability to zoom. There is also an Aspose watermark across the final PDF page.

Is this simply because I don’t have the licensed version? Can anyone verify that this library produces high quality PDF’s with the licensed version?

@virgev,
Hello.
Could you please provide your initial DWF file and the code you to get the result PDF.

Here is the code sample and link to the file (would allow me to attach). If I can get this to work, I will have to loop through a directory of hundreds (potentially 1000+) files to convert:

File link: Box | Login

import aspose.cad as cad

image = cad.Image.load("MB_test.dwf")

rasterizationOptions = cad.imageoptions.CadRasterizationOptions()
rasterizationOptions.page_width = 830.0
rasterizationOptions.page_height = 620.0
rasterizationOptions.content_as_bitmap = True

pdfOptions = cad.imageoptions.PdfOptions()
pdfOptions.vector_rasterization_options = rasterizationOptions
pdfOptions.core_pdf_options = cad.imageoptions.PdfDocumentOptions()

image.save("MB_test.pdf", pdfOptions)

@virgev,
This file is not available for me to download via this service unfortunately. Could you please attach it here? Could you please remove rasterizationOptions.content_as_bitmap = True and check if quality is better?

I’ll try that option first. This tool wouldn’t allow me to select the file in DWF format, but maybe if I change the extension. I’ll try

Ok - my bad; I don’t know this stuff very well. Removing that line from the code worked and my image looks exactly how I want it to now.

Thank you for the help!!

1 Like

@virgev,
we were happy to help :slight_smile: