1

我目前正在尝试找到一个无需运行 X 服务器即可运行的 PDF 库。我已经尝试过以下...

  1. Migradoc/PDFSharp(需要 X)
  2. ITextSharp(需要 X)
  3. SharpPDF(可能有用,但我正在寻找具有更多功能的东西)

该库不必是开源的或免费的。

我的解决方案在 Apache2.2 mod_mono 上运行。

有人知道这样的图书馆吗?

- - 编辑 - -

下面列出了用于 itextsharp 的测试代码,它会在我的测试服务器上产生错误(Migradoc 和 SharpPDF 的代码同样简单):

using System;
using sharp=iTextSharp.text;
using iTextSharp.text.pdf;
using iTextSharp.text.xml;
using System.IO;

namespace pdftester
{
    public static class ITextSharpTest
    {
        public static void HelloWorld(string filename)
        {
            Stream stream = new FileStream(filename, FileMode.Create);
            sharp.Document document = new sharp.Document();
            PdfWriter.GetInstance(document, stream);
            document.Open();
            document.Add(new sharp.Paragraph("Hello world"));
            document.Close();
        }
    }    
}
4

1 回答 1

0

由于没有人对该线程给出明确的答案,因此我将其关闭。

我选择了使用 sharpPDF 方式,因为它是我的服务器上唯一支持的方式。我只需要实现我的项目所需的东西。

感谢到目前为止收到的帮助:)

于 2010-08-27T15:04:00.860 回答