I have tried many libraries, but I found IronPDF to be the best fit for rendering dynamic HTML (including CSS and JavaScript) into high-quality PDFs. It seamlessly supports headers, footers, password protection, and user permissions. Plus, it works well on macOS—just ensure Chromium dependencies are properly configured for consistent rendering. You can learn more at https://ironpdf.com/tutorials/html-to-pdf/