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

Free Support Forum - aspose.com

PDF to RTF

Hi,


If I want to have pdf to rtf conversion, in what package I will find that?

Aspose.pdf?
Aspose.word?

Hi Muzna,


Thank you for contacting support. There is no direct way to convert a PDF to RTF format. You can convert a PDF to DOC/DOCX using Aspose.Pdf API, and then DOC/DOCX to RTF format using Aspose.Words API. Please try the following code example:

[.NET, C#]

<span class=“rem” style=“color: rgb(0, 128, 0); font-family: “Courier New”, Consolas, Courier, monospace; font-size: small; white-space: pre;”>//load the PDF<span style=“color: rgb(0, 0, 0); font-family: “Courier New”, Consolas, Courier, monospace; font-size: small; white-space: pre;”>
Aspose.Pdf.Document pdfDoc = <span class=“kwrd” style=“color: rgb(0, 0, 255); font-family: “Courier New”, Consolas, Courier, monospace; font-size: small; white-space: pre;”>new<span style=“color: rgb(0, 0, 0); font-family: “Courier New”, Consolas, Courier, monospace; font-size: small; white-space: pre;”> Aspose.Pdf.Document(“c:/pdftest/ZoomValue.pdf”);<span style=“color: rgb(0, 0, 0); font-family: “Courier New”, Consolas, Courier, monospace; font-size: small; white-space: pre;”>
MemoryStream outDOC = <span class=“kwrd” style=“color: rgb(0, 0, 255); font-family: “Courier New”, Consolas, Courier, monospace; font-size: small; white-space: pre;”>new<span style=“color: rgb(0, 0, 0); font-family: “Courier New”, Consolas, Courier, monospace; font-size: small; white-space: pre;”> MemoryStream();<span style=“color: rgb(0, 0, 0); font-family: “Courier New”, Consolas, Courier, monospace; font-size: small; white-space: pre;”>
Aspose.Pdf.DocSaveOptions saveOptions = <span class=“kwrd” style=“color: rgb(0, 0, 255); font-family: “Courier New”, Consolas, Courier, monospace; font-size: small; white-space: pre;”>new<span style=“color: rgb(0, 0, 0); font-family: “Courier New”, Consolas, Courier, monospace; font-size: small; white-space: pre;”> Aspose.Pdf.DocSaveOptions();<span style=“color: rgb(0, 0, 0); font-family: “Courier New”, Consolas, Courier, monospace; font-size: small; white-space: pre;”>
saveOptions.Mode = Aspose.Pdf.DocSaveOptions.RecognitionMode.Flow;<span style=“color: rgb(0, 0, 0); font-family: “Courier New”, Consolas, Courier, monospace; font-size: small; white-space: pre;”>
<span class=“rem” style=“color: rgb(0, 128, 0); font-family: “Courier New”, Consolas, Courier, monospace; font-size: small; white-space: pre;”>// save PDF in the DOC format<span style=“color: rgb(0, 0, 0); font-family: “Courier New”, Consolas, Courier, monospace; font-size: small; white-space: pre;”>
pdfDoc.Save(outDOC, saveOptions);<span style=“color: rgb(0, 0, 0); font-family: “Courier New”, Consolas, Courier, monospace; font-size: small; white-space: pre;”>
<span class=“rem” style=“color: rgb(0, 128, 0); font-family: “Courier New”, Consolas, Courier, monospace; font-size: small; white-space: pre;”>// load DOC file<span style=“color: rgb(0, 0, 0); font-family: “Courier New”, Consolas, Courier, monospace; font-size: small; white-space: pre;”>
Aspose.Words.Document doc = <span class=“kwrd” style=“color: rgb(0, 0, 255); font-family: “Courier New”, Consolas, Courier, monospace; font-size: small; white-space: pre;”>new<span style=“color: rgb(0, 0, 0); font-family: “Courier New”, Consolas, Courier, monospace; font-size: small; white-space: pre;”> Aspose.Words.Document(outDOC);<span style=“color: rgb(0, 0, 0); font-family: “Courier New”, Consolas, Courier, monospace; font-size: small; white-space: pre;”>
<span class=“rem” style=“color: rgb(0, 128, 0); font-family: “Courier New”, Consolas, Courier, monospace; font-size: small; white-space: pre;”>// save DOC file in the RTF format<span style=“color: rgb(0, 0, 0); font-family: “Courier New”, Consolas, Courier, monospace; font-size: small; white-space: pre;”>
doc.Save(“c:/pdftest/ZoomValue.rtf”, Aspose.Words.SaveFormat.Rtf);

<span style=“color: rgb(0, 0, 0); font-family: “Courier New”, Consolas, Courier, monospace; font-size: small; white-space: pre;”>