Posted 2 March 2022, 1:00 pm EST
How can i check if page in pdf file is empty
Forums Home / Document Solutions / Document Solutions for PDF
Posted by: moshek on 2 March 2022, 1:00 pm EST
Posted 2 March 2022, 1:00 pm EST
How can i check if page in pdf file is empty
Posted 3 March 2022, 6:54 am EST
Hello Moshe,
There is no direct way to delete the empty page in pdf. But as a workaround you can use the following code:
for(int i= doc.Pages.Count-1; i >= 0; i--)
{
if(doc.Pages[i].GetStream() == null)
{
doc.Pages.RemoveAt(i);
}
}
Regards,
Prabhat Sharma.