PLT Drawings
Export PLT to JPEG
Aspose.CAD for Java allows developers to render PLT files to JPEG. Following is the code demonstrating how to access the PLT file and convert that to JPEG using CadRasterizationOption and JpegOptions.
String PLTPathToFile = dataDir + "50states.plt"; | |
Image image = Image.load(PLTPathToFile); | |
//Setting PDF Options | |
ImageOptionsBase imageOptions = new JpegOptions(); | |
CadRasterizationOptions cadRasterizationOptions = new CadRasterizationOptions(); | |
cadRasterizationOptions.setDrawType(CadDrawTypeMode.UseObjectColor); | |
cadRasterizationOptions.setPageHeight(1600); | |
cadRasterizationOptions.setPageWidth(1600); | |
cadRasterizationOptions.setBackgroundColor(com.aspose.cad.Color.getBlack()); | |
imageOptions.setVectorRasterizationOptions(cadRasterizationOptions); | |
//Saving to Image | |
image.save(dataDir+"50states.jpeg", imageOptions); | |
Export PLT to PDF
Aspose.CAD for Java allows developers to render PLT files to PDF. Following is the code demonstrating how to access the PLT file and convert that to PDF using CadRasterizationOption and PdfOptions.
String dataDir = Utils.getDataDir(ExportPLTtoPDF.class) + "PLTDrawings\\"; | |
String PLTPathToFile = dataDir + "50states.plt"; | |
Image image = Image.load(PLTPathToFile); | |
//Setting PDF Options | |
PdfOptions pdfOptions = new PdfOptions(); | |
CadRasterizationOptions cadRasterizationOptions = new CadRasterizationOptions(); | |
cadRasterizationOptions.setDrawType(CadDrawTypeMode.UseObjectColor); | |
cadRasterizationOptions.setPageHeight(1600); | |
cadRasterizationOptions.setPageWidth(1600); | |
cadRasterizationOptions.setBackgroundColor(com.aspose.cad.Color.getBlack()); | |
pdfOptions.setVectorRasterizationOptions(cadRasterizationOptions); | |
//Saving to PDF | |
image.save(dataDir+"50states.pdf", pdfOptions); | |