在c#中将PDF、Doc和Docx转换为rtf

发布于 2024-11-06 01:49:13 字数 195 浏览 5 评论 0原文

我需要一个能够将 Doc、Docx 和 PDF 转换为 RTF 的应用程序。

转换是一种方式,我不需要转换回 Doc 或 PDF。

有人这样做过吗?你能推荐一个库吗?我知道有 aspose,但它太贵了,而且许可证是每年的,所以这不适用于我碰巧工作的公司。

如果需要的话,我可以为每种文件类型使用多个库。

提前致谢

I have a requirement for an application that takes Doc, Docx and PDF and converts them to RTF.

The conversion is one way and I do not need to convert back to Doc or PDF.

Has anyone done this and can you recommend a libray? I know there is aspose but it's way to pricey and the licenses are per year so that's not going to work for the company I happen to work for.

I'm ok using more than one library for each of the file types if thats what it takes.

Thanks in advance

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

眼中杀气 2024-11-13 01:49:13

Telerik 有一个很好的库可以做到这一点。他们实际上有一个看起来像 Microsoft Word 的完整编辑器。它可以打开多种文件格式,并且本地保存为 RTF(尽管它可以保存为 PDF、DOCX 等)。我不确定的一件事是打开 PDF 并保存为 RTF。我不确定 Telerik 库可以做到这一点。

这是该库的链接:
http://www.telerik.com/products/wpf/richtextbox.aspx

对于 PDF 到 RTF 库,您可以使用以下命令:
http://www.sautinsoft.com/products/pdf-focus/index.php

Telerik has a nice library to do this. They actually have an entire editor that looks like Microsoft Word. It can open multiple file formats and it saves natively as RTF (although it can save as PDF, DOCX, etc.) The one thing I'm not sure of is opening the PDF and saving as an RTF. I'm not sure that the Telerik library can do that.

Here is a link to the library:
http://www.telerik.com/products/wpf/richtextbox.aspx

For a PDF to RTF library, you could use this:
http://www.sautinsoft.com/products/pdf-focus/index.php

瑶笙 2024-11-13 01:49:13

GroupDocs.Conversion Cloud 是一个 REST API,可以可靠、轻松地将所有常见文件格式从一种格式转换为另一种格式。其免费定价计划每月提供 50 个免费积分。

以下是从默认存储中将 PDF 转换为 RTF 的示例代码:

// Get App Key and App SID from https://dashboard.groupdocs.cloud/
var configuration = new GroupDocs.Conversion.Cloud.Sdk.Client.Configuration(MyAppSid, MyAppKey);
var apiInstance = new ConvertApi(configuration);

try
{
    // convert settings
    var settings = new GroupDocs.Conversion.Cloud.Sdk.Model.ConvertSettings
    {
        StorageName = null,
        FilePath = "02_pages.pdf",
        Format = "rtf",
        ConvertOptions = new RtfConvertOptions(),
        OutputPath = "02_pages.rtf"
    };

    // convert to specified format
    List<StoredConvertedResult> response = apiInstance.ConvertDocument(new ConvertDocumentRequest(settings));
    Console.WriteLine("Document converted successfully: " + response[0].Url);
}
catch (Exception e)
{
    Console.WriteLine("Exception when calling ConvertApi.QuickConvert: " + e.Message);
}

我是 aspose 的开发人员布道者。

GroupDocs.Conversion Cloud is a REST API that converts all common file formats from on format to another reliably and easily. Its free pricing plan offers 50 free credits per month.

Here is sample code for PDF to RTF from default storage:

// Get App Key and App SID from https://dashboard.groupdocs.cloud/
var configuration = new GroupDocs.Conversion.Cloud.Sdk.Client.Configuration(MyAppSid, MyAppKey);
var apiInstance = new ConvertApi(configuration);

try
{
    // convert settings
    var settings = new GroupDocs.Conversion.Cloud.Sdk.Model.ConvertSettings
    {
        StorageName = null,
        FilePath = "02_pages.pdf",
        Format = "rtf",
        ConvertOptions = new RtfConvertOptions(),
        OutputPath = "02_pages.rtf"
    };

    // convert to specified format
    List<StoredConvertedResult> response = apiInstance.ConvertDocument(new ConvertDocumentRequest(settings));
    Console.WriteLine("Document converted successfully: " + response[0].Url);
}
catch (Exception e)
{
    Console.WriteLine("Exception when calling ConvertApi.QuickConvert: " + e.Message);
}

I'm developer evangelist at aspose.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文