Free Support Forum - aspose.com

Paragraph is pushed down to next page after DOCX>HTML>DOCX conversion using C#

Hi Support Team,

We are looking for solutions for few of things for one of our client. Which are :

  1. Doc/Docx to html (String)
  2. Html (String) to Docx
  3. Pdf to html (String)
  4. Html (String) to Pdf
  5. Html (String) to Blob

So, On our RnD we found that you are providing services related to these conversion. so we have started looking in nuget package for .net c# and first we have started with the docx file to html one. but we are facing few issues. suggest us is there any limitations in trial vs paid?

There was a problem while converting docx file to html. The issue which we are facing are

  1. Not getting first 5-7 lines in the html.
  2. Page header is not showing on html page as showing on the every page of document.

@Harsh_Yadav

Please note that in evaluation mode there are some limitations applied. E.g. Aspose.Words injects an evaluation watermark at the top of the document. The document’s content are truncated after a certain number of paragraphs during import or export.

Please get 30 days temporary license and apply it before using Aspose.Words’ classes.

If you still face problem, please attach the following resources here for testing:

  • Your input documents.
  • Please attach the output file that shows the undesired behavior.
  • Please attach the expected output file that shows the desired 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 will start investigation into your issue and provide you more information. Thanks for your cooperation.

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

Screenshot (8).png (103.3 KB)
Screenshot (9).png (105.2 KB)

Hi Support,
Thanks for your help.

I convert a docx file to html string and again convert html string to docx file. I am facing issue of auto shift issue. If any content reached till end of document. It automatically creating new page. As shown in Screenshots.

@Harsh_Yadav

Unfortunately, it is difficult to say what the problem is without documents and code example. We need your documents and code for testing purpose. So, please share the requested resources here for testing. We will investigate the issue and provide you more information on it.

Document.zip (45.7 KB)

Hello
For converting docx file to html string I used this c# code

Aspose.Words.Document doc = new Aspose.Words.Document(FileUrl);
HtmlSaveOptions options = new HtmlSaveOptions();
options.ExportImagesAsBase64 = true;
doc.Save(htmlFilePath + “.html”, options);

From this I get the html string. After getting html string as result I user another code to convert html string to docx file.

Aspose.Words.Document doc = new Aspose.Words.Document(FileUrl);
doc.Save(htmlFilePath+".docx", SaveFormat.Docx);

Attached zip file has the actual docx file, resulted docx file and html string.

@Harsh_Yadav

We have tested the scenario using the shared documents and code example and have not found these issues at our side. Could you please share the input document for which you are facing these issues? Moreover, please share the screenshots of problematic sections of output document. We will investigate this issue further and provide you more information on it.

Thank’s tahir for your support. After using 30 days temporary license I am not facing this issue.

Currently I am facing line shifting issue while converting html string to docx file. I am attaching both the files (Original and result). In result document, it make two page document while the actual file is only of single page document.
Doc.zip (40.6 KB)

@Harsh_Yadav

We have tested the scenario and have managed to reproduce the same issue at our side. For the sake of correction, we have logged this problem in our issue tracking system as WORDSNET-19823. You will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.