Blank page is created when HTML is inserted into document using .NET

getting blank page in word document when user writing html content to word document using aspose.words?

Hi,

Please accept my apologies for late response.

Thanks for your query. It would be great if you please share your documents and html contents used in your code for investigation purposes.

Hi,

Please accept my apologies for late response.

Thanks
for your query. It would be great if you please share your documents
and html contents used in your code for investigation purposes.

I already attached an zip file which contains word document and pdf with second page as blank page......From my observation iam getting blank page in word document and pdf only after margins are setted in word document ..pls go through margins code given in previous post...(Before setting margins in word document or pdf iam not able to see blank page in word document and pdf ) and also even i pasted code in my previous post..pls go through tht one......

Again iam attaching the same zip file here for reference.....pls have a look..

or

Is there any method to remove the Blank page in word document and pdf?

@deepi

The shared Zip file contains only two image files. Please see that attached image file.

The Word document is flow document and does not contain any information about its layout into lines and pages. Therefore, technically there is no “Page” concept in Word document. However, you can remove empty sections using Aspose.Words. Please see the following code:

//Open document

Document doc = new Document(@“in.doc”);


//Search for empty sections

ArrayList sectList = new ArrayList();

foreach(Section sect in doc.Sections)

{

if(sect.Body.FirstParagraph.IsEndOfSection &&string.IsNullOrEmpty(sect.Body.FirstParagraph.ToTxt().Trim()))

{

sectList.Add(sect);

}

}

//remove empty sections

foreach (Section sect in sectList)

{

sect.Remove();

}

//Save output document

doc.Save(@“AsposeOut.doc”);

Please share your documents and HTML contents for investigation purposes.