You can find all details about PLT conversion at: Convert PLT to PDF or JPEG Image Programmatically in C#
Created
January 18, 2021 21:07
-
-
Save aspose-com-gists/d97bd34e06bb77f2b2a1e7d773b41039 to your computer and use it in GitHub Desktop.
Convert PLT to PDF, JPEG, or PNG File Programmatically in C#
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
// The path to the documents directory. | |
string sourceFilePath = MyDir + "50states.plt"; | |
// Load input PLT file | |
using (Image cadImage = Image.Load(sourceFilePath)) | |
{ | |
// Initilize JpegOptions class instance | |
ImageOptionsBase imageOptions = new JpegOptions(); | |
// Specify CadRasterizationOptions properties | |
CadRasterizationOptions options = new CadRasterizationOptions | |
{ | |
PageHeight = 500, | |
PageWidth = 1000, | |
}; | |
imageOptions.VectorRasterizationOptions = options; | |
// Convert PLT to JPEG image format | |
cadImage.Save(MyDir+ "50states.jpg", imageOptions); | |
} |
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 sourceFilePath = MyDir + "50states.plt"; | |
// Load input PLT file | |
using (Image cadImage = Image.Load(sourceFilePath)) | |
{ | |
// Set different properties for CadRasterizationOptions | |
CadRasterizationOptions options = new CadRasterizationOptions | |
{ | |
PageHeight = 1600, | |
PageWidth = 1600, | |
DrawType= CadDrawTypeMode.UseObjectColor, | |
BackgroundColor=Color.White | |
}; | |
// Specify PdfOptions for rendering | |
PdfOptions pdfOptions = new PdfOptions(); | |
pdfOptions.VectorRasterizationOptions = options; | |
// Convert PLT to PDF file and save output document | |
cadImage.Save(MyDir+ "50states.pdf", pdfOptions); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment