RTF Conversion

Hi GroupDocs,

We’re running into an issue that seems to occur when converting .RTF documents with tiny left/right margins to PDF. Part of the document gets cut off when you try to view it in Adobe Reader after conversion. The same does not happen if you convert the .RTF to .PDF via Microsoft Word.

Here is our code:

public async Task<Stream> RenderDocumentAsPdfAsync(Stream document, string documentName)

{
Guard.ArgumentNotNull(document,“document”);
Guard.ArgumentNotNullOrEmpty(documentName, “documentName”);

var config = GetViewerConfig();
var imgHandler = new ViewerImageHandler(config);
var pdfOptions = GetPdfOptions();
var fileContainer = new FileContainer();

try
{
    var memoryStream = new MemoryStream();
    await document.CopyToAsync(memoryStream); 
    fileContainer = await Task.Run(() => imgHandler.GetPdfFile(memoryStream, pdfOptions));

}
catch (Exception ex)
{
    ApplicationLogger.LogError(string.Format("Conversion of document {0} to PDF failed.  Exception: {1}", documentName, ex.ToString()), 
        MethodBase.GetCurrentMethod(), exception: ex);
    return null;
}
return fileContainer.Stream;

private static ViewerConfig GetViewerConfig()

{

var config = new ViewerConfig()
{                
    UseCache = false,
};
return config;            

}

GroupDocs Viewer version is at 17.8. I’m attaching a specific file that the issue occurs with
Please let me know if any other info is needed!

Adjusting Journal Entries-10_10 JO.pdf (66.6 KB)

Best,

Brett

@bdrake,

Thanks for using GroupDocs.Viewer and posting your issue here. Would you please share with us the RTF document as well so that we can investigate the issue at our end. We shall be looking forward to hearing from you.

My mistake. Here it is!

Adjusting Journal Entries-10_10 JO.zip (2.8 KB)

-Brett

@bdrake,

Thanks for providing the problematic document. We are able to reproduce your reported issue at our end. The issue has been logged in our Issue Tracking System (with ID: VIEWERNET-1504) for further investigation. We’ll keep you informed in case of any updates.

@usman.aziz

Hi! Has there been any update on this fix? Updated to 18.3 and realized we were still having this issue :frowning: .

Appreciate any info!

-Brett

@bdrake,

Thanks for coming back to us.

I am afraid that your reported issue is still under investigation and is not fixed yet. However, we are looking into it to check if we can provide you any updates regarding its status. We appreciate your patience and cooperation in this regards.

1 Like

Hi GroupDocs! Has there been any update on this bug?

-Brett

@bdrake,

Thanks for coming back to us.

I am afraid that your reported issue is not fixed yet because of some other blocking issues. We shall keep you notified in case of any further updates. We appreciate your patience and cooperation in this regard.