<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Ray</title>
    <description>The latest articles on DEV Community by Ray (@impulsive_thoughts_c53672).</description>
    <link>https://dev.to/impulsive_thoughts_c53672</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4166533%2Ff8d920aa-49fb-4a0d-a1af-de62d3f251a5.png</url>
      <title>DEV Community: Ray</title>
      <link>https://dev.to/impulsive_thoughts_c53672</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/impulsive_thoughts_c53672"/>
    <language>en</language>
    <item>
      <title>Building a 100% Client-Side Invoice &amp; Thermal Receipt Generator with Astro and Canvas</title>
      <dc:creator>Ray</dc:creator>
      <pubDate>Thu, 08 Oct 2026 13:18:28 +0000</pubDate>
      <link>https://dev.to/impulsive_thoughts_c53672/building-a-100-client-side-invoice-thermal-receipt-generator-with-astro-and-canvas-3ble</link>
      <guid>https://dev.to/impulsive_thoughts_c53672/building-a-100-client-side-invoice-thermal-receipt-generator-with-astro-and-canvas-3ble</guid>
      <description>&lt;p&gt;When building utility web apps, developers often reach for a full-stack architecture (database, auth, API routes) by default. But for document generation tools—like invoices and receipts—a serverless, zero-backend approach offers massive advantages in &lt;strong&gt;speed, user trust, and operating cost&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Here is an architectural breakdown of how I built &lt;a href="https://generaterealinvoice.com" rel="noopener noreferrer"&gt;Generate Real Invoice&lt;/a&gt; using Astro, React, and client-side PDF generation.&lt;/p&gt;




&lt;h3&gt;
  
  
  1. Zero Backend = Zero Data Liabilities
&lt;/h3&gt;

&lt;p&gt;Invoicing tools handle sensitive information: client names, physical addresses, hourly billing rates, and tax identification numbers. &lt;/p&gt;

&lt;p&gt;By keeping calculations and document compilation entirely on the client:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;No user data is stored on remote servers (automatic GDPR compliance).&lt;/li&gt;
&lt;li&gt;Users don't need to create accounts or authenticate to get their PDF.&lt;/li&gt;
&lt;li&gt;Server operating costs remain near zero because Cloudflare Pages only serves static assets.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  2. Solving Thermal POS Receipt Rendering
&lt;/h3&gt;

&lt;p&gt;Standard CSS print styles (&lt;code&gt;@media print&lt;/code&gt;) usually target standard Letter or A4 paper. Printing to compact Bluetooth or USB thermal receipt printers (58mm or 80mm rolls) presents unique challenges:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Font Blurring:&lt;/strong&gt; Standard anti-aliased proportional fonts turn fuzzy on 203-DPI printheads. Using fixed monospaced fonts (&lt;code&gt;Courier&lt;/code&gt;, &lt;code&gt;JetBrains Mono&lt;/code&gt;) keeps characters crisp.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Roll Boundaries:&lt;/strong&gt; Fixed CSS roll constraints prevent desktop browsers from ejecting excessive trailing blank paper:&lt;/li&gt;
&lt;/ul&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
css
@page {
  size: 80mm auto;
  margin: 0;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>astro</category>
      <category>showdev</category>
    </item>
  </channel>
</rss>
