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:

原文地址:https://www.cnblogs.com/jizhiqiliao/p/9996190.html