import aspose.cad as cad;

cadImage = cad.Image.load("file.dxf");

rasterizationOptions = cad.imageoptions.CadRasterizationOptions();

rasterizationOptions.layouts = ["Model"]

pdfOptions = cad.imageoptions.PdfOptions();
pdfOptions.vector_rasterization_options = rasterizationOptions;

cadImage.save("result.pdf", pdfOptions)