• 在C#.NET中,如何生成PDF文件?主要有以下几个途径


    1.使用.NET文件流技术;
    若通过.NET的文件流技术生成PDF文件,必须对PDF文件的语法很清楚,例如BT表示实体内容开始;ET表示实体内容结束;TD表示换行等等。我们可以从Adobe的官方网站上下载PDF的语法说明文档,但文档几乎有1000页。如果熟悉好语法以后再编程,花费的时间肯定很长,而且生成的PDF文档不一定能满足要求。有关C# 代码参见附件。
    有关PDF文件的语法详见:
    http://partners.adobe.com/public/developer/en/pdf/PDFReference.pdf
    2.使用第三方控件
    I.开源控件
    ① ASP.NET FO PDF at SourceForge.net - generates XSL-FO from DataTable to render PDF
    ② iTextSharp at SourceForge.net
    1.Examples and Tutorial: http://itextsharp.sourceforge.net/
    2.Also see this article: Create PDF on the fly with .NET and iTextSharp by Valerio Fornito, DoPostBack.com
    ③ PDFCreator at GotDotNet - design PDF document visually using Visual Studio IDE
    ④ Report.NET at SourceForge.net
    II.商业控件
    ① ABCpdf .NET by WebSupergoo - free license also available
    ② Apoc XSL-FO by Chive Software - generates PDF using XSL-FO
    ③ Aspose.Pdf by Aspose
    ④ DynamicPDF by ceTe Software
    ⑤ PDF4NET by O2 Solutions
    ⑥ PDFLib by PDFLib GmbH
    ⑦ TallPDF.NET by TallComponents - able to create PDF documents either programmatically using an object model or from XML.
    Tutorial: Create and manipulate PDF documents - 100% .NET by Frank Rem (CodeProject.com)
    ⑧ XMLPDF by Visual Programming - converts XML to PDF
    从成本考虑,使用开源控件是一个不错的选择。在我所作的项目中,就采用了iTextSharp组件,生成的PDF文件能够满足项目要求。有关iTextSharp的DLL、源代码和编码实例都可以从http://itextsharp.sourceforge.net/获得。
    3.使用Acrobat Distiller
    可以在C# 或者脚本文件(.js 或 .vbs)中直接调用Acrobat Distiller对象,从而生成PDF文件。但是从版权考虑,则需购买Adobe Acrobat Professional。
    代码可参考以下网址:
    http://dev.yesky.com/msdn/123/2101623.shtml

  • 相关阅读:
    免费的视频、音频转文本
    Errors are values
    Codebase Refactoring (with help from Go)
    Golang中的坑二
    Cleaner, more elegant, and wrong(msdn blog)
    Cleaner, more elegant, and wrong(翻译)
    Cleaner, more elegant, and harder to recognize(翻译)
    vue控制父子组件渲染顺序
    computed 和 watch 组合使用,监听数据全局数据状态
    webstorm破解方法
  • 原文地址:https://www.cnblogs.com/alqscool/p/5613296.html
Copyright © 2020-2023  润新知