【问题标题】:How to implement pdf in asp.net using C# or JavaScript [closed]如何使用 C# 或 JavaScript 在 asp.net 中实现 pdf [关闭]
【发布时间】:2014-06-09 18:55:48
【问题描述】:

我正在创建一个关于在线电影票预订的项目。现在我想创建一个票的pdf文件。如何创建或生成 pdf 文件。

【问题讨论】:

标签: c# javascript asp.net pdf-generation


【解决方案1】:

我以前用过PDF4Net,非常好用。

【讨论】:

    【解决方案2】:

    要生成pdf,请参考以下代码

            Document document = new Document(iTextSharp.text.PageSize.LETTER, 10, 10, 42, 35);
            PdfWriter writer = PdfWriter.GetInstance(document , new FileStream(@"C:\YourPdf.pdf", FileMode.Create));
            document .Open();
            Paragraph paragraph = new Paragraph("Hi, \n This is my pdf file");
            document .Add(paragraph);
            document .Close();
    

    更多信息:-

    http://www.codeproject.com/Articles/686994/Create-Read-Advance-PDF-Report-using-iTextSharp-in

    http://www.dotnetfox.com/articles/how-to-create-pdf-document-in-Asp-Net-with-C-Sharp-using-itextsharp-1023.aspx

    【讨论】:

    • 您可能需要添加有关 OP 使用此代码所需的第三方库的信息。
    • 是的@DaveParsons 我添加了更多信息的链接
    【解决方案3】:

    另外我用过PDFSharp,非常简单直观! 干杯

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-02-06
      • 2021-10-31
      • 2017-08-16
      • 2011-02-16
      相关资源
      最近更新 更多