问题
I'm using iTextSharp (with C# and VS2008) to generate a report from a database table row. Generate PDF is not a problem... but when I try to add RTF text into the PDF I cant't find a way into iTextSharp object structure.
How can I do it?
Thanks a lot!
回答1:
Consider converting your RTF to HTML and then writing your HTML to PDF using iTextSharp.
I've never done this but here are some resources that might help:
Writing Your Own RTF Converter
Need help with creating PDF from HTML using itextsharp
回答2:
Try to use iTextSharp.text.rtf.parser.RtfParser
回答3:
Try using HtmlToPdfBuilder class at www.hugoware.net from Hugo Bonacci. It shall convert HTML to PDF with external stylesheet as well.
来源:https://stackoverflow.com/questions/2823544/itextsharp-writing-rtf-in-a-pdf-document