Welcome to PDF Print Demo
This page demonstrates how to print a webpage as a PDF using JavaScript's native print functionality. When you click the "Print as PDF" button, your browser's print dialog will open, allowing you to save the page as a PDF document.
How it works:
- Click the "Print as PDF" button in the header
- Your browser's print dialog will appear
- Select "Save as PDF" as the destination
- Choose your preferred settings and save
Additional Information
The print functionality uses the browser's built-in window.print() method, which is
supported by all modern browsers. The page includes special CSS rules (using @media print) to
optimize the layout for printing, such as hiding the print button itself.
You can customize the print styles to control exactly how your document appears in the PDF. This includes adjusting margins, hiding specific elements, or changing colors for better print readability.
Browser Support:
- Chrome: Full support with "Save as PDF" option
- Firefox: Full support with PDF export
- Safari: Full support on macOS
- Edge: Full support with native PDF creation