We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Clear document content

Hi Team,

How to clear document content?

I tried


It removes content and header footer section as well.

I just want a blank document with header footer intact.

Thanks and Regards,

Hi Nakul,

Thanks for your inquiry. Please try run the following code to be able to remove all the child nodes of document Body inside each Section:

foreach (Section sec in doc.Sections)





I hope, this helps.

Best regards,