Free Support Forum - aspose.cloud

Convert PDF to RTF API of Aspose.Words REST API creates a large output RTF file

Hi,
On converting 3.4MB PDF file to rtf format using [Get] : /words/{name} API , the resulting file content has size 566MB(takes too much time to get response and, some times API keeps on loading and gives the error response.).
Please look into below files for refence:-
The file input I’m giving to API is :
1686193-1 - Search Package.pdf (3.4 MB)
Please let me know how to over come the above issues.
Thanks.

@vinodhkumar

I have tested the scenario with your shared document. I have noticed the output file size, so logged a ticket WORDSCLOUD-1572 for further investigation. We will keep you updated about the issue resolution progress within this forum thread.

1 Like

@tilal.ahmad any update on the output file size?

@vinodhkumar

After the initial investigation, we noticed that the issue is inherited from Aspose.Words for .NET. The issue will be fixed in Aspose.Wrods for .NET in the first place and then fix will be ported to Aspose.Wrods Cloud. We will notify you as soon as the issue is fixed and ported to Aspose.Words Cloud.

@vinodhkumar

We have completed a further investigation and found it is not a bug. The issue is not about Aspose.Words or MS Word, it is about RTF format. Generally, DOCX format is more compact than RTF because it’s a ZIP archive. RTF on the other hand is a text format.
In your particular case, the document contains 56 images. When it is written to RTF each byte is written as 2 chars (hex string), i.e. 1byte=2bytes in the output document. Also, the images are written twice in the output RTF file to be properly displayed in the old readers. And as a result, you get a very big output document.

So we won’t fix exactly this issue, because it cannot be fixed, but we will introduce a new ExportImagesForOldReaders property in SaveOptions to SaveAs method. By setting this property false you will get a much smaller RTF file. We will notify you as soon as this new feature(WORDSCLOUD-1583) is implemented.

@vinodhkumar

We have fixed WORDSCLOUD-1583 ticket. We have introduced an ExportImagesForOldReaders property in RTFSaveOptions. Now you can use the SaveAs method to convert PDF to RTF with required settings. Please check the following API methods and documentation article for more details. Please feel free to contact us with any questions or concerns.

PUT ​/words​/{name}​/saveAs Converts a document in cloud storage to the specified format.

PUT ​/words​/online​/put​/saveAs Converts a document from local drive to the specified format.