<?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: Sadguru</title>
    <description>The latest articles on DEV Community by Sadguru (@sadguruchenu).</description>
    <link>https://dev.to/sadguruchenu</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%2F4250465%2F8c693acf-589b-4dea-bc2c-8bdfd0b441b9.png</url>
      <title>DEV Community: Sadguru</title>
      <link>https://dev.to/sadguruchenu</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/sadguruchenu"/>
    <language>en</language>
    <item>
      <title>Building a Resume Editor That Exports Real Text: A4 Layout, Vector PDFs and DOCX</title>
      <dc:creator>Sadguru</dc:creator>
      <pubDate>Tue, 17 Nov 2026 19:54:22 +0000</pubDate>
      <link>https://dev.to/sadguruchenu/building-a-resume-editor-that-exports-real-text-a4-layout-vector-pdfs-and-docx-f7a</link>
      <guid>https://dev.to/sadguruchenu/building-a-resume-editor-that-exports-real-text-a4-layout-vector-pdfs-and-docx-f7a</guid>
      <description>&lt;p&gt;On paper, building a resume editor sounds like a weekend project. &lt;/p&gt;

&lt;p&gt;You throw together a two-column layout: form inputs on the left, a live preview on the right, and a shiny "Download PDF" button up top. Simple, right?&lt;/p&gt;

&lt;p&gt;Except it almost never is. &lt;/p&gt;

&lt;p&gt;The moment a user actually relies on your tool to apply for a job, expectations skyrocket. They expect the exported file to mirror the on-screen preview pixel for pixel. They expect it to fit neatly onto standard A4 paper without awkward blank gaps. They want the typography intact. And most importantly: they expect the output to be a &lt;em&gt;living, breathing document&lt;/em&gt;—one with selectable, copyable text that applicant tracking systems (ATS) can actually parse, and maybe even a Word (.docx) file they can tweak later.&lt;/p&gt;

&lt;p&gt;While building &lt;strong&gt;Pagewise&lt;/strong&gt;, I quickly realized a fundamental truth that reshaped how I approached the entire architecture:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;A document that looks great in a web browser isn’t guaranteed to survive printing, PDF parsing, or external word processors.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Most web tools take the easy way out and treat resumes like glorified screenshots. We wanted Pagewise to treat a resume as a real document. &lt;/p&gt;

&lt;p&gt;Here is how we tackled the engineering headaches behind making that happen.&lt;/p&gt;




&lt;h3&gt;
  
  
  1. The A4 Problem: A Browser Is Not a Sheet of Paper
&lt;/h3&gt;

&lt;p&gt;Web browsers are built for fluid, responsive layouts. Documents are the exact opposite they are strictly bound by physical dimensions.&lt;/p&gt;

&lt;p&gt;An A4 page is strictly:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Width:&lt;/strong&gt; 210 mm&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Height:&lt;/strong&gt; 297 mm&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When you design a document editor purely using pixels or viewport percentages, you set yourself up for heartbreak. A layout might look gorgeous on a 1440p monitor, but the second the user tries to print or export it, things fall apart:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Browser print drivers apply arbitrary scaling.&lt;/li&gt;
&lt;li&gt;Default margins eat away at your layout.&lt;/li&gt;
&lt;li&gt;Sections awkwardly break right across the middle of a job title.&lt;/li&gt;
&lt;li&gt;Content spills over onto a practically empty second page.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To solve this, we had to stop treating the canvas like a responsive webpage and start treating it as a physical medium. &lt;/p&gt;

&lt;p&gt;Our CSS establishes a rigid document boundary matching real-world paper dimensions:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.resume-page&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;210mm&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;min-height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;297mm&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;box-sizing&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;border-box&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;position&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;relative&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;background&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mh"&gt;#ffffff&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;@media&lt;/span&gt; &lt;span class="nt"&gt;print&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;@page&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;size&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;A4&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;margin&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="nc"&gt;.resume-page&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;210mm&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;min-height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;297mm&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;margin&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nl"&gt;box-shadow&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;none&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;Note: This is a simplified snippet, but it highlights the core mindset shift.&lt;/em&gt; &lt;/p&gt;

&lt;p&gt;Of course, CSS dimensions alone don’t magically solve pagination. When a user writes a lengthy work history, handling dynamic overflow without severing bullet points mid-sentence requires active content measurement and calculated page breaks.&lt;/p&gt;




&lt;h3&gt;
  
  
  2. Typography Is Document Geometry, Not Just Decoration
&lt;/h3&gt;

&lt;p&gt;One of the sneakiest bugs we ran into had nothing to do with margins or flexbox it was fonts.&lt;/p&gt;

&lt;p&gt;In web design, a font change is mostly cosmetic. In fixed-geometry document design, &lt;strong&gt;fonts dictate layout math.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A subtle change in font weight, letter spacing, or line height can:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Alter exact line-wrapping points.&lt;/li&gt;
&lt;li&gt;Expand a 2-line bullet point into 3 lines.&lt;/li&gt;
&lt;li&gt;Increase section height by just 4 pixels... pushing an entire section onto an unwanted second page.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This becomes a nightmare when your frontend preview uses local system fonts or Google Fonts, while your backend PDF engine runs on a Linux server that has neither. When the server falls back to standard Helvetica or DejaVu Sans, your carefully calibrated single-page resume suddenly bleeds into page two.&lt;/p&gt;

&lt;h4&gt;
  
  
  Our Font Normalization Matrix
&lt;/h4&gt;

&lt;p&gt;To combat this, we set up a controlled normalization strategy. Whenever a user picks a common font, our pipeline pairs it with verified, metrically close open-source equivalents across environments:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Requested Font&lt;/th&gt;
&lt;th&gt;Normalized / Open-Source Equivalent&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Georgia&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Lora / Liberation Serif&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Arial&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Arimo&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Calibri&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Carlito&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Are they 100% identical down to the sub-pixel kerning pair in every environment? No. But this controlled mapping drastically reduces surprise layout shifts. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The takeaway:&lt;/strong&gt; If typography shifts between preview and export, your document geometry breaks. Font consistency must be treated as an infrastructure problem.&lt;/p&gt;




&lt;h3&gt;
  
  
  3. The "Canvas Trap": Why We Refused to Flatten to Images
&lt;/h3&gt;

&lt;p&gt;If you look at how many modern web apps generate PDFs, you'll see a very common shortcut:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Run &lt;code&gt;html2canvas&lt;/code&gt; to take a screenshot of the DOM.&lt;/li&gt;
&lt;li&gt;Slap that raster image inside a &lt;code&gt;jsPDF&lt;/code&gt; wrapper.&lt;/li&gt;
&lt;li&gt;Call it a day.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;It looks identical to the preview! It’s fast to build! &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;And it produces a terrible resume.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;When you turn a document into a flat picture, you destroy its utility:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Screenshot / Canvas PDF&lt;/th&gt;
&lt;th&gt;True Vector &amp;amp; Text PDF&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Text is baked into flat pixels&lt;/td&gt;
&lt;td&gt;Text remains sharp, selectable, and highlightable&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Copy-pasting text is impossible&lt;/td&gt;
&lt;td&gt;Recruiters can easily copy contact info or bullet points&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ATS parsers fail or require messy OCR&lt;/td&gt;
&lt;td&gt;ATS software reads native text streams directly&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Blurry when zoomed in or printed&lt;/td&gt;
&lt;td&gt;Crisp vector rendering at any scale&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Zero screen-reader accessibility&lt;/td&gt;
&lt;td&gt;Screen-reader friendly&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Imagine a recruiter trying to copy your email or phone number from a resume, only to find they're clicking on a JPEG. Or worse, an automated ATS pipeline rejecting your application because it couldn't extract a single keyword from an image.&lt;/p&gt;

&lt;p&gt;At Pagewise, we committed to &lt;strong&gt;true vector text&lt;/strong&gt;. When you download a PDF, the text remains real, selectable text. While no format can guarantee 100% compatibility across every single outdated ATS parser in existence, outputting real text gives candidates the best possible shot.&lt;/p&gt;




&lt;h3&gt;
  
  
  4. One Data Model, Two Completely Different Export Paths
&lt;/h3&gt;

&lt;p&gt;People don’t just want PDFs. A huge chunk of users still need an editable Microsoft Word (&lt;code&gt;.docx&lt;/code&gt;) file—whether to submit through job portals that require it or to make custom adjustments for a specific application.&lt;/p&gt;

&lt;p&gt;The naive solution would be trying to convert the rendered HTML into Word, or exporting an image into a DOCX file. Both create a mess.&lt;/p&gt;

&lt;p&gt;Instead, we decoupled our &lt;strong&gt;document state&lt;/strong&gt; from our &lt;strong&gt;rendering targets&lt;/strong&gt;. A single JSON resume model feeds into an export dispatcher with two dedicated pipelines:&lt;br&gt;
              ┌────────────────────────┐&lt;br&gt;
              │  Resume Document Model │&lt;br&gt;
              └───────────┬────────────┘&lt;br&gt;
                          │&lt;br&gt;
                  Export Dispatcher&lt;br&gt;
                         / \&lt;br&gt;
                        /   \&lt;br&gt;
                       v     v&lt;br&gt;
          ┌─────────────────┐ ┌─────────────────┐&lt;br&gt;
          │ Visual Pipeline │ │   python-docx   │&lt;br&gt;
          │  (Vector PDF)   │ │  (XML-level)    │&lt;br&gt;
          └────────┬────────┘ └────────┬────────┘&lt;br&gt;
                   │                   │&lt;br&gt;
                   v                   v&lt;br&gt;
          ┌─────────────────┐ ┌─────────────────┐&lt;br&gt;
          │ Sharp, ATS-ready│ │ Native Editable │&lt;br&gt;
          │   PDF Document  │ │   Word Styles   │&lt;br&gt;
          └─────────────────┘ └─────────────────┘&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Path A (Visual PDF):&lt;/strong&gt; Renders the document model through a headless browser environment configured with strict print stylesheets, generating real text, vector borders, and predictable page breaks.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Path B (Native DOCX):&lt;/strong&gt; Feeds the raw structured data into &lt;code&gt;python-docx&lt;/code&gt;. Instead of hacking HTML tags into Word, it builds real Word paragraphs, native headings, real bullet lists, and genuine XML table structures.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This means when a user opens the &lt;code&gt;.docx&lt;/code&gt; file in Microsoft Word, they aren’t fighting broken floating textboxes or glued-together layouts—they get a clean, standard Word document styled with native typography.&lt;/p&gt;




&lt;h3&gt;
  
  
  5. The Hard Reality: Document Fidelity Is an Ongoing Battle
&lt;/h3&gt;

&lt;p&gt;Does having a single data model magically solve every cross-format inconsistency? &lt;/p&gt;

&lt;p&gt;Honestly? No.&lt;/p&gt;

&lt;p&gt;Word and web browsers use fundamentally different layout engines. Word calculates line wraps, margin collapse, and paragraph spacing under its own rules. &lt;/p&gt;

&lt;p&gt;A layout that comfortably leaves 15mm of breathing room at the bottom of an A4 PDF might push the last bullet point onto page two in Microsoft Word. A header accent bar that looks sleek in CSS requires a careful table border hack in DOCX XML.&lt;/p&gt;

&lt;p&gt;Maintaining parity between on-screen previews, generated PDFs, and native Word documents isn’t a one-and-done feature. It’s an ongoing process of calibrating margins, tuning line heights, and testing edge cases.&lt;/p&gt;




&lt;h3&gt;
  
  
  6. What Building This Taught Us
&lt;/h3&gt;

&lt;p&gt;Building Pagewise forced us to look past the surface of web UI and think deeply about document architecture. &lt;/p&gt;

&lt;p&gt;A resilient document editor has to separate three distinct layers:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Content:&lt;/strong&gt; The raw data (your jobs, dates, skills, metrics).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Presentation:&lt;/strong&gt; How that data looks right now on the screen.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Target Output:&lt;/strong&gt; How that data must behave inside an external ecosystem (A4 paper, Adobe Acrobat, Word, ATS scanners).&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;When you keep those concerns clean and distinct, the system stops being a fragile hack and starts behaving like a real document engine.&lt;/p&gt;




&lt;h3&gt;
  
  
  What's Next?
&lt;/h3&gt;

&lt;p&gt;We're continuing to refine Pagewise’s rendering engine to make multi-page handling and layout customization even smoother. Alongside the document pipeline, we've also introduced &lt;strong&gt;Wiser AI&lt;/strong&gt; a companion tool that helps analyze job descriptions, flag missing skills, and suggest targeted resume improvements without taking away user control.&lt;/p&gt;

&lt;p&gt;If you want to see how the editor works in practice (or test the exports yourself), check it out here:&lt;br&gt;
👉 &lt;strong&gt;&lt;a href="https://pagewise.sadguruchenu.in/" rel="noopener noreferrer"&gt;Pagewise&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  Let's Chat
&lt;/h3&gt;

&lt;p&gt;If you’ve built document editors, invoice generators, or report exporters:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;How do you bridge the gap between browser DOM previews and print/export parity?&lt;/li&gt;
&lt;li&gt;Do you use headless browser rendering, native PDF libraries, or something else entirely?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I'd love to hear how other teams handle this in the comments!&lt;/p&gt;

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