How to Convert HTML to PDF: Web Pages and Emails

Need to save a web page or HTML email as a PDF? Here's how to capture web content reliably.

Why Convert HTML to PDF?

Save Web Pages

  • Archive important articles
  • Save receipts and confirmations
  • Keep reference material offline
  • Document web content as evidence

Save Emails

  • Archive important correspondence
  • Create records for legal/business
  • Share formatted emails
  • Backup Gmail/Outlook messages

Create Documents

  • Generate reports from web data
  • Convert web apps to printable format
  • Create documentation from online sources

Method 1: Browser Print to PDF (Easiest)

Works in Chrome, Edge, Firefox, Safari:

Steps:

  1. Open the web page
  2. Press Ctrl+P (Cmd+P on Mac)
  3. Set destination to "Save as PDF" or "Microsoft Print to PDF"
  4. Adjust settings:
  5. Layout (portrait/landscape)
  6. Pages (all or selection)
  7. Margins
  8. Background graphics
  9. Click Save/Print
  10. Choose save location

Chrome-Specific Tips

Print background graphics:
- More settings > Check "Background graphics"
- Ensures colors and images appear

Headers and footers:
- Uncheck to remove URL/date stamps
- Or keep for documentation

Firefox Tips

Simplify page first:
- Reader View (F9) removes ads/clutter
- Then print to PDF

Method 2: Online HTML to PDF Converter

For URLs or HTML files:

  1. Go to lexosign.com/html-to-pdf
  2. Enter URL or upload HTML file
  3. Set options
  4. Convert and download

Advantages:
- Consistent rendering
- Additional options
- Works from any device

Method 3: Browser Extensions

Install extensions for one-click saving:

Popular options:
- Save as PDF (Chrome)
- Print Friendly (removes clutter)
- SingleFile (saves complete page)

Pros: Quick, convenient
Cons: Another extension to manage

Method 4: Command Line (Advanced)

For developers and automation:

wkhtmltopdf:

wkhtmltopdf https://example.com output.pdf

Puppeteer (Node.js):

const browser = await puppeteer.launch();
const page = await browser.newPage();
await page.goto('https://example.com');
await page.pdf({path: 'output.pdf'});

Best for: Batch conversion, automation, server-side generation.

Saving Different Content Types

Regular Web Pages

Standard process works well:
- Print to PDF
- Most formatting preserved
- Links may or may not work

Single Page Applications (SPAs)

React, Vue, Angular sites:
- May need to wait for content to load
- Print after page fully renders
- Some dynamic content may not capture

Password-Protected Pages

Content behind login:
- Log in first
- Then print to PDF
- Or use screenshot if print is blocked

Infinite Scroll Pages

Social media, news feeds:
- Scroll to load desired content first
- Select specific content if possible
- May need multiple saves

Saving Emails as PDF

Gmail

  1. Open the email
  2. Click three dots menu
  3. Select "Print"
  4. Choose "Save as PDF"
  5. Save

Alternative: Forward to a service that converts to PDF

Outlook (Desktop)

  1. Open the email
  2. File > Print
  3. Select PDF printer
  4. Print/Save

Outlook (Web)

  1. Open the email
  2. Click three dots
  3. Print
  4. Save as PDF

Apple Mail

  1. Open email
  2. File > Export as PDF
  3. Choose location
  4. Save

Improving PDF Quality

Remove Clutter First

Before saving:
- Use Reader View if available
- Install ad blocker
- Print specific selection instead of whole page

Adjust Page Settings

In print dialog:
- Choose appropriate margins
- Select portrait or landscape
- Enable background graphics for colors

Custom CSS (Advanced)

Add print-specific styles:

@media print {
  .ads, .navigation { display: none; }
  body { font-size: 12pt; }
}

Preserving Links

Clickable Links in PDF

Browser print usually preserves:
- Internal page links
- External URL links
- Email links

Verifying Links Work

After saving:
- Open PDF
- Click links to test
- Note: Some viewers don't support PDF links

Handling Images

Images Not Appearing

Causes:
- Background graphics setting off
- Images loading slowly
- Blocked resources

Fixes:
- Enable background graphics
- Wait for page to fully load
- Try online converter

Image Quality

For high-quality images:
- Use higher DPI setting if available
- Print at larger page size, scale down later
- Consider screenshot + convert for complex layouts

Multi-Page Websites

Saving Multiple Pages

For entire websites:
- Use website-to-PDF tools
- HTTrack + batch convert
- Specialized archiving tools

Creating Combined Document

  1. Save each page as PDF
  2. Merge PDFs into one document
  3. Add table of contents if needed

Troubleshooting

Blank Pages

Cause: Print stylesheet hides content
Fix: Try different browser or online converter

Missing Content

Cause: JavaScript-loaded content not rendered
Fix: Wait for full load, try different tool

Formatting Broken

Cause: Print CSS differs from screen CSS
Fix: Adjust page settings, try landscape mode

File Too Large

Cause: Many high-resolution images
Fix: Compress the PDF after saving

Conclusion

Converting HTML to PDF is straightforward:

  1. Browser print for most web pages
  2. Online tools for consistent results
  3. Extensions for frequent use
  4. Command line for automation

For simple conversions, browser print works great. For complex pages or batch processing, use specialized tools.

Save important web content before it disappears. Websites change, links break, content gets removed. A PDF archive ensures you always have access.

Try LexoSign Free

Edit, sign, merge, and convert PDFs online - no signup required.

Get Started Free