Hi
Anyone guide me to remove blank pages from Word, Excel and PowerPoint documents before converting these documents to TIFF format using Aspose SDK's.
Thanks,
Dhivya
Hi
Anyone guide me to remove blank pages from Word, Excel and PowerPoint documents before converting these documents to TIFF format using Aspose SDK's.
Thanks,
Dhivya
Hi,
Hi Dhivya,
Presentation pres=new Presentation(“D:\Test.ppt”);Slides slide;for (int i=0; i<pres.Slides.Count;i++){slide=pres.Slides[i];if(slide.Shapes.Count==0){pres.Slides.Remove(slide);i–;}}
Hello Dhivya,
Thanks for your request. I'm a representative for Aspose.Words.
MS 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.
But I think in your case you can delete all empty paragraphs from the end of the document, please see the following code:
// Remove empty paragraphs from the end of the document.
while (doc.LastSection.Body.LastParagraph != null &&
string.IsNullOrEmpty(doc.LastSection.Body.LastParagraph.GetText().Trim()))
doc.LastSection.Body.LastParagraph.Remove();
Hope this helps.
Best regards,