Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Tue Dec 11, 2018 9:47 am

Hi,

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?

pavelzotov
 
Posts: 8
Joined: Fri Jul 06, 2018 9:34 am

Tue Dec 11, 2018 9:52 am

Hi,

Thank you for your inquiry.
Could you please share the sample RTF document to help us investigate the issue?

Sincerely,
Jane
E-iceblue support team
User avatar

Jane.Bai
 
Posts: 1156
Joined: Tue Nov 29, 2016 1:47 am

Tue Dec 11, 2018 10:00 am

I'm afraid i cannot do that since that document contains private information of our customers.
Is there a better way to convert files from one format to another? I was wondering because if you open RTF document in Word it is perfectly fine but i cannot manage to move this markup to either PDF or DOC format :(

pavelzotov
 
Posts: 8
Joined: Fri Jul 06, 2018 9:34 am

Tue Dec 11, 2018 10:09 am

Hi,

Thank you for your feedback.
Generally, a 10 pages document would not be converted to 2 pages. It's hard to say why this issue occurs without the document.
If you were using the free version or old version, I suggest that you first try the latest hotfix Spire.Doc Pack(hot fix) Version:6.12.1 which has more fixes. If the issue still exists after trying the hotfix, I'm afraid we still need the document for investigation. You could remove the private information or replace them with dummy data as long as the issue could be reproduced. You can send to us via email support@e-iceblue.com.

Sincerely,
Jane
E-iceblue support team
User avatar

Jane.Bai
 
Posts: 1156
Joined: Tue Nov 29, 2016 1:47 am

Tue Dec 11, 2018 11:33 am

Oh wow. The hotfix that you have provided solved the problem! Now it seems to work as expected. Thank you a lot! It seems that i didn't use the latest version.

P.S. for those who stops on this topic: Code that i have provided can be used to convert document from one format to another :)

pavelzotov
 
Posts: 8
Joined: Fri Jul 06, 2018 9:34 am

Wed Dec 12, 2018 1:57 am

Hi,

Thank you for your valuable feedback.
Just feel free to contact us if you need any assistance in the future. :)

Sincerely,
Jane
E-iceblue support team
User avatar

Jane.Bai
 
Posts: 1156
Joined: Tue Nov 29, 2016 1:47 am

Return to Spire.PDF