Empty Page

Posted by: moshek on 2 March 2022, 4:00 am EST

    • Post Options:
    • Link

    Posted 2 March 2022, 4:00 am EST

    How can i check if page in pdf file is empty

  • Posted 2 March 2022, 9:54 pm 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.

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels