Inserting RTF and DOC into PDF

I have downloaded trial versions of Aspose.Words and Aspose.PDF and have enjoyed exploring the capabilities of the products.


I am working on a project where I need to insert the contents of a .doc or .rtf file into an existing PDF. This means I cannot simply convert the .doc to a .pdf and concatenate the resulting documents.

Is it possible to read the contents of the .doc/.rtf file and insert it into a PDF in a defined area of a PDF page? I was able to do this by converting the .doc/.rtf file to an image file (.jpeg/.tiff/.png) and pasting the image into the PDF, but this results in very large PDF files.

I know there must be a way to do this, but I am still very new to the Aspose libraries. If anyone has any experience inserting .doc/.rtf data into PDFs I would love to hear about it. Thanks!

Hi Rick,


Thanks for using our products.

In order to accomplish your requirement, you need to first convert DOC/RTF file into PDF format using Aspose.Words for .NET and then insert these converted pages into existing PDF file using Aspose.Pdf for .NET. For further details, please visit Insert PDF pages

In case you need to add the converted page on a specific page region, you may consider adding the pages as stamp object. Please follow the instructions specified over following link for Adding PDF Page Stamp in the PDF File

In the event of any further query, please feel free to contact.

Hi Nayyer,


Excellent, this worked perfectly!

The final PDF is roughly half of the size as the PDF with the inserted .rtf image.

Is this the preferred method of inserting .rtf data into a PDF or is there a way to eliminate the first step of converting the original file?

Thanks for your help.

Rick
rickm81:
Is this the preferred method of inserting .rtf data into a PDF or is there a way to eliminate the first step of converting the original file?
Hi Rick,

Aspose.Pdf for .NET only deals/manipulates PDF documents and in order to insert .RTF contents into PDF file, it must be first converted into PDF format and then added as stamp object. Else, you can extract the PDF contents (Image, Text, Attachments, Annotations) from source .RTF/.DOC file and programatically place them inside PDF file using Aspose.Pdf for .NET. But when using this approach, you need to manually determine the location where these objects need to be placed (When using this approach, there are chances that the formatting of document/contents is disturbed).