HiQPdf
Software
Documentation
Pricing
hiqpdf.com
Select HTML Elements to Exclude from PDF
Use this demo to exclude selected parts of an HTML page from conversion to PDF by entering a CSS selector. You can either provide a page URL or paste HTML code, optionally with a base URL. The selector allows you to choose exactly which content will be excluded from the PDF. You can choose to remove or simply hide the excluded elements.
Convert HTML with Base URL
Convert URL or Local File
HTML String To Convert
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>Exclude HTML Elements from Conversion Demo</title> <link href="styles/webfonts.css" type="text/css" rel="stylesheet"> <style> body { font-family: Verdana, sans-serif; font-size: 16px; margin: 0; padding: 0; background-color: #f9f9f9; } header, footer { background-color: #e0e0e0; text-align: center; padding: 20px; color: #333; } #ExcludedHtmlElement { padding: 30px; background-color: #ffffff; margin: 20px auto; max-width: 800px; box-shadow: 0 0 10px rgba(0,0,0,0.1); } .image-container { text-align: center; margin: 20px 0; } img { max-width: 100%; height: auto; border-radius: 8px; box-shadow: 0 0 10px rgba(0,0,0,0.2); } h2 { color: #0055a5; } </style> </head> <body> <header> <h1>Exclude HTML Elements from Conversion to PDF</h1> <p>This header will be included in the PDF.</p> </header> <!-- This section will be excluded from PDF --> <div id="ExcludedHtmlElement"> <h2>Content to be Excluded from PDF</h2> <p>This section contains the HTML elements that will be excluded from the generated PDF file. It includes text, images and basic formatting.</p> <div class="image-container"> <a href="http://www.hiqpdf.com"> <img alt="Logo Image" src="Images/HiQPdfLogo.png" /> </a> </div> </div> <footer> <p>This is the footer section that should be included in the PDF.</p> </footer> </body> </html>
Base URL
HTML Page to Convert URL
Excluded HTML Elements Options
CSS Selector:
Enable CSS Selector
Remove Excluded Elements
Convert HTML to PDF