Image cuts to bottom half while exporting in aspose.words c#

I am trying to export an image to microsoft word document. The image randomly cuts to bottom half in IE 11. It is working fine in all other browsers such as Chrome, Mozilla , Edge. Please help me in resolving this issue.

Thanks,
Sumit

@sumitbhargav3162,

Thanks for your inquiry. To ensure a timely and accurate response, please attach the following resources here for testing:

  • Your input Word/Image document.
  • Please attach the output document that shows the undesired behavior.
  • Please create a standalone console application (source code without compilation errors) that helps us to reproduce your problem on our end and attach it here for testing.

As soon as you get these pieces of information ready, we’ll start investigation into your issue and provide you more information. Thanks for your cooperation.

PS: To attach these resources, please zip and upload them.

Hi Tahir,

Thanks for your response.

As per your requirements, I have created a console app to produce the same issue, unfortunately, that issue isn’t happening on console application. I am not sure that the problem is with the code or with the browser on IE, because it is working fine on other browsers like chrome/mozilla.
Could you please tell me the main cause of image gets to half in IE 11 only?

There were other issues also happening such as extra page gets added before and after the image in word document in IE which still happens here in console application also. I haven’t kept any page break or any section break in between.

Could you please help me out with this issue?

Note- Please add Aspose.words.dll file at the location
aspose_query\Export2Word\exportToWord\exportToWord\bin\Debugaspose_query.zip (1.6 MB)

Thanks,
Sumit

@sumitbhargav3162,

Thanks for sharing the detail.

In this case, we suggest you please remove the empty paragraph from the template document before «TableStart:WordExport». We have attached the modified document and output with this post for your kind reference.
Docs.zip (550.3 KB)

We have tested the scenario using latest version of Aspose.Words for .NET 18.1 and have not found any issue with output Word document. Please use Aspose.Words for .NET 18.1.

Could you please share complete detail of your use case how are you checking the output in browsers? We have not found any issue when output Word document is opened in MS Word 2016.

Hi Tahir,

Thanks for your response.

I have used the modified document in Docs.zip in the same console application and it is still showing the 3 pages in the exported word file and the image is on the 2nd page. The modified document didn’t worked, FYI , i am using MS Word 2010 to open the exported document, i hope that wont matters.

Thanks,
Sumit

@sumitbhargav3162,

Thanks for your inquiry. Please use the cleanup options as shown below and apply the license. You can request for 30 days temporary license.

Please refer to the following article.
Removing Empty Paragraphs

doc.MailMerge.CleanupOptions =
MailMergeCleanupOptions.RemoveEmptyTableRows |
MailMergeCleanupOptions.RemoveEmptyParagraphs |
MailMergeCleanupOptions.RemoveUnusedRegions;

Hi Tahir,

Thanks for your response.

I have applied for the temporary license and waiting for their response. Meanwhile, i had added your code for the clean up before saving the document but unfortunately, it didn’t worked too.
Still, it’s showing 3 pages and the image is coming on the 2nd page while the 1st and the 3rd pages are empty.This is really giving me headaches. Please help me fixing the issue.

Thanks,
Sumit

@sumitbhargav3162,

Thanks for your inquiry. We have attached the modified code and documents with this post for your kind reference. Please check the “Img.docx” from the attachment. exportToWord.zip (744.3 KB)

We have not found the shared issue when document is opened in MS Word 2010 and 2016. Please check the attached screenshot. ms word 2010output.png (77.5 KB)

Hi Tahir,

Thanks for your response.

It has finally worked. There is one thing which i didn’t understand in this part. The clean Up code such as
CloneDoc.MailMerge.CleanupOptions =
MailMergeCleanupOptions.RemoveEmptyTableRows |
MailMergeCleanupOptions.RemoveEmptyParagraphs |
MailMergeCleanupOptions.RemoveUnusedRegions;
I was using the above code after
CloneDoc.MailMerge.ExecuteWithRegions(_dataSet);
But in the code which you had modified it is mentioned before.
Does that makes any difference in removing the empty pages and regions? Why wasn’t it removing when i had kept it after the ExecuteWithRegion line of code?

Thanks,
Sumit

@sumitbhargav3162,

Thanks for your inquiry. Yes, the cleanup options should be used before calling MailMerge.ExecuteWithRegions method.

Please let us know if you have any more queries.

Hi Tahir,

Thanks for your response.

There is one more issue i am facing while exporting to pdf/ppt.
Whenever i am doing export, it takes a lots of time in all the browsers. The size of the word/Ppt template is nearly 500 kb. Could you please tell me the core reason for this issue?

Thanks,
Sumit

@sumitbhargav3162,

I have observed your comments related to issue facing in exporting presentation to PDF. I suggest you to please first try using Aspose.Slides for .NET 17.12.1 on your end. If you still find an issue then please provide a working sample application along with platform information and statistics achieved on your end. Please also share the source presentation and generated PDF as well for reference. I will be able to investigate the issue further and share my feedback on provision of requested information.

@sumitbhargav3162,

Thanks for your inquiry. Please note that performance and memory usage all depend on complexity and size of the documents you are generating. While rendering a document to fixed page formats (e.g. PDF), Aspose.Words needs to build two model in the memory – one for document and the other for rendered document.

The process of building layout model is not linear; it may take a minute to render one page and may take a few seconds to render 100 pages. We are always working on improving performance; but, rendering will be always running slower than simple saving to flow formats (e.g. doc/docx).