رسومات PLT
Contents
[
Hide
]تصدير PLT إلى JPEG
يسمح Aspose.CAD لـ Java للمطورين برسم ملفات PLT إلى JPEG. فيما يلي الكود الذي يوضح كيفية الوصول إلى ملف PLT وتحويله إلى JPEG باستخدام CadRasterizationOption و JpegOptions.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
تصدير PLT إلى PDF
يسمح Aspose.CAD لـ Java للمطورين برسم ملفات PLT إلى PDF. فيما يلي الكود الذي يوضح كيفية الوصول إلى ملف PLT وتحويله إلى PDF باستخدام CadRasterizationOption و PdfOptions.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |