如何使用objects属性保存pdf

时间:2014-09-20 22:46:57

标签: c# asp.net-mvc pdfsharp

我正在使用PdfSharp生成报告。我想用" JobName"保存生成的报告。对象的属性。添加当前日期/时间将是很好的。我想要使​​用的属性是" job.JobName"

 // Save the document...
           const string filename = @"C:\Users\texas_000\Desktop\TexasExterior\TexasExterior\JobSetupPdfs\HelloWorld.pdf";

            document.Save(filename);

1 个答案:

答案 0 :(得分:0)

var filename = string.Format(@"C:\Users\texas_000\Desktop\TexasExterior\TexasExterior\JobSetupPdfs\{0}{1}.pdf", job.JobName, job.JobDate);
    document.Save(filename);