How to fetch header and footer from pdf document

hello community -I need to know the different way to fetch header and footer from pdf document.