What's the best way to convert a FlowDocument into PDF

前端 未结 6 2091
萌比男神i
萌比男神i 2021-02-04 13:36

How would ya\'ll recommend that I convert a FlowDocument to PDF to be attached to an EMail?

The FlowDocument is dynamic, not static.

I would prefer to be able to

6条回答
  •  伪装坚强ぢ
    2021-02-04 14:39

    You might want to consider the product called "Report Writer for .NET" by Seberix (http://www.siberix.com/). Its API is similar to the code behind in FlowDocument which I think is you want want when you said "dynamic, not static". (But I'm sure there are differences as well. Devils are in the details).

    Once a Siberix.Report.Report object has been created,

    Siberix.Report.Report report = CreateMyPdfReport();  //You write this
    Stream stream = new MemoryStream();
    report.Publish(stream, Siberix.Report.FileFormat.PDF);
    byte[] bytes = stream.ToArray();
    

    Now bytes can be saved to a database table or whatever.

提交回复
热议问题