请问导出PDF方法,如何能生成pdf文件流
var outputDirectory = new DirectoryInfo(outputDirectorypath);
//导出至某个盘符
outputDirectory.Create();
// Provide settings for your rendering output.
// Provide settings for your rendering output.
GrapeCity.ActiveReports.Export.Pdf.Page.Settings pdfSetting = new GrapeCity.ActiveReports.Export.Pdf.Page.Settings();
//pdfSetting.Title = $"{file_name}_{Guid.NewGuid()}";
// Set the rendering extension and render the report.
GrapeCity.ActiveReports.Export.Pdf.Page.PdfRenderingExtension pdfRenderingExtension = new GrapeCity.ActiveReports.Export.Pdf.Page.PdfRenderingExtension();
GrapeCity.ActiveReports.Rendering.IO.FileStreamProvider outputProvider = new GrapeCity.ActiveReports.Rendering.IO.FileStreamProvider(outputDirectory, Path.GetFileNameWithoutExtension($"{bill_id}_{StringExtension.GetRandomString(4)}"));
// Overwrite output file if it already exists
outputProvider.OverwriteOutputFile = true;
report.Document.Render(pdfRenderingExtension, outputProvider, pdfSetting);
|
|