Convert dxf to pdf

Here is the conversion code:

private void import_Click(object sender, EventArgs e)
{
    string dpath = @"D:\pic.dxf";
    string ppath = @"D:\pic.pdf";
    createPdf(dpath, ppath);
}

private static void createPdf(string dxfPath, string pdfPath)
{
    BackSlashPath documentConverter = new BackSlashPath(dxfPath);
    BackSlashPath outputDocument = new BackSlashPath(pdfPath);
    var outputFormat = (DocumentFormat)Enum.Parse(typeof(DocumentFormat), "Pdf");
    var result = GleamTech.DocumentUltimate.DocumentConverter.Convert(documentConverter, outputDocument, outputFormat);
}

Before using it, you need to add "DocumentUltimate" from "NuGet". The specific operation is as follows: Right click the Reference and select "Manage NuGet Packages...", then type "DocumentUltimate" in the search bar and install it:

posted @ 2018-11-21 17:01  Kyle0418  阅读(550)  评论(0)    收藏  举报