I have an RTF document and, as it usually happens, it is opened by Word.
So in Word there are 10 pages for that document. However, if i try to convert RTF to Docx or PDF format there are only 2 pages and all content is 'merged' into 2 pages so it is impossible to read the document.
I do it like this (rtfData is byte array (byte[])):
- Code: Select all
using (MemoryStream rtfStream = new MemoryStream(rtfData))
using (MemoryStream pdfStream = new MemoryStream())
{
Document rtfDocument = new Document(rtfStream, FileFormat.Rtf);
rtfDocument.SaveToStream(pdfStream, FileFormat.PDF);
return pdfStream.ToArray();
}
So my question is: how do i convert RTF to PDF document so that it contains exactly same pages as an RTF document opened by Word?