We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Building a PDF with mixed content sources

Hi There, looking to trial your .NET PDF product however wanted to check it will do what I need first.

I am constructing PDF documents from scratch in C#, the source content comes from various places. One thing I need to be able to do is read RTF from my SQL server (which I can do now) and add that RTF into a pdf at a certain place which is not always the same.

The source is in RTF as it contains superscript characters that plain text can’t handle. An example would be building a specification sheet that might have Volume: 104cm/kg where the 4 is in superscript.

Ideally I would simply like to insert the subscript string and have the API add it to the PDF correctly without first having to convert it to something else first.

Can you let me know if and how to achieve this?



Thank you for contacting support.

We are afraid Aspose.PDF does not support adding RTF on a PDF page or rendering RTF to PDF. Respective feature requests are already logged in our issue management system. Therefore, you may use Aspose.Words for .NET API to convert RTF to PDF document; then you may add specific pages to any PDF file using Insert or Add methods which are exposed by Document class, as explained in Working with Pages.

Below code can be used to convert RTF to PDF with Aspose.Words for .NET API.

MemoryStream memoryStream = new MemoryStream(File.ReadAllBytes(MyDir + "input.rtf"));
Aspose.Words.LoadOptions loadOption = new Aspose.Words.LoadOptions();
loadOption.LoadFormat = LoadFormat.Rtf;
var doc = new Document(memoryStream, loadOption);
doc.Save(MyDir + "19.2.pdf");

In case you face any problem, feel free to contact us. We will be more than glad to assist you further.