Free RTF to PDF .NET component or tool? [closed]

2019-05-19 17:13发布

问题:

I am trying to convert a RTF file to a PDF. All tools I found so far cost a lot of money. Is there a tool which I could call or component I could use which converts existing RTF files to PDFs? If its a tool, it should have command line support so I can call it from the code. I am using C#...

Thanks

回答1:

I wrote a class to do this using the Office Interop assemblies. If you have MS Word installed on the machine executing the code, this works well. http://brandonzeider.me/2010/microsoft-net/convert-word-to-pdf/



回答2:

Yes, iTextSharp can't convert RTF to PDF, but it seems it can convert HTML to PDF. Maybe you can convert your RTF to HTML and next give it to iTextSharp. There is a free RTF to HTML tools in Internet.



回答3:

You can do the conversion in two steps:

  1. Parse the RTF data
  2. Write the PDF document

For the first step I have written this library. For the second step I have used a commercial product, but any open source library should also work.



回答4:

You could use iTextSharp to create pdf documents.