How I Built an EML-to-PDF Converter in 1-2 Hours with Claude Code

The Problem: A Vendor That Only Issues Receipts via Email

When purchasing a certain service, I needed a PDF receipt with a valid invoice number. However, the vendor did not support PDF receipt issuance and only sent receipts as email (EML files).

Under Japan’s Electronic Book Preservation Act (Denshichoubo Hozonhou), we need to import receipt images into our accounting software. Unfortunately, our accounting software only accepts PDF format, so we could not upload EML files directly.

“Why Not Just Build a Converter?”

I considered manually taking screenshots of the emails and converting them to PDF, but similar situations were likely to come up again. So I decided to build a tool that converts EML files to PDF.

Writing email parsing and PDF generation logic from scratch would be tedious, though. That’s where Claude Code came in.

Building with Claude Code

Development Flow

I told Claude Code to “create a Python script that reads EML files and converts them to PDF,” and it quickly generated a script with the following features:

  • EML file reading and parsing (subject, sender, recipient, date, body extraction)
  • Support for both HTML and plain text emails
  • PDF generation with Japanese font support
  • Attachment information display

Time Spent

The first working prototype was ready in about 30 minutes. Including fine-tuning (Japanese character encoding fixes, layout adjustments, error handling), the entire project took only 1-2 hours.

Previously, just researching the right libraries might have taken half a day. Thanks to Claude Code generating the code scaffold quickly, I could focus on adjustments and refinements.

Results

When I tested the tool on actual email receipt EML files, it worked exactly as expected:

  • Email subject, date, and sender info displayed as a header
  • Body text cleanly laid out in the PDF
  • Important information like invoice numbers preserved as-is
  • Generated PDFs could be uploaded directly to our accounting software

We can now store email receipts in our accounting software in a format that complies with Japan’s Electronic Book Preservation Act.

Takeaways from Developing with Claude Code

Here’s what I appreciated about using Claude Code for this project:

  • Speed: From library selection to code generation, everything progressed through conversation
  • Practical code: The generated code worked out of the box with only minor tweaks needed
  • Knowledge gap filling: Even in unfamiliar areas like EML parsing and PDF generation, Claude Code suggested appropriate libraries and implementation approaches

Conclusion

What started as a mundane problem — a vendor that only issues email receipts — was solved in just 1-2 hours by building an EML-to-PDF converter with Claude Code.

As compliance with Japan’s Electronic Book Preservation Act becomes increasingly important, small tools like this can make accounting workflows much smoother. If you’re facing a similar challenge, consider leveraging Claude Code for your workflow automation.

At Microfund, we will continue sharing our AI-powered workflow improvements on this blog.