Free Support Forum - aspose.com

Delete Blank Pages from PDF using Aspose.PDF for .NET

Can pdf.kit delete blank pages in a pdf? How would it detect the blank page?

Hi,

Thank you for considering Aspose.

Although you can delete a specified page from Pdf using Aspose.Pdf.Kit but I am afraid that there is no such functionality to find a blank page.

Thanks.

@derekmhartyahoo

You can detect as well as delete blank pages from a PDF document now using Aspose.PDF for .NET 20.7. Below code snippet can be used to obtain your requirements:

Detect and Remove Blank Page from PDF

Document pdfDocument = new Document("Test.pdf");
bool isBlank = pdfDocument.Pages[1].IsBlank(0.01d);
// Delete a particular page
pdfDocument.Pages.Delete(1);
// Save updated PDF
pdfDocument.Save("output.pdf");