<?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: CareerPDF</title>
    <description>The latest articles on DEV Community by CareerPDF (@careerpdf).</description>
    <link>https://dev.to/careerpdf</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%2F4204484%2F9f12fe3a-f686-4620-848b-55f5708392b1.png</url>
      <title>DEV Community: CareerPDF</title>
      <link>https://dev.to/careerpdf</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/careerpdf"/>
    <language>en</language>
    <item>
      <title>Why Arabic Text Breaks in Browser PDFs (And How to Fix It 100% Client-Side)</title>
      <dc:creator>CareerPDF</dc:creator>
      <pubDate>Sat, 24 Oct 2026 11:44:43 +0000</pubDate>
      <link>https://dev.to/careerpdf/why-arabic-text-breaks-in-browser-pdfs-and-how-to-fix-it-100-client-side-7c3</link>
      <guid>https://dev.to/careerpdf/why-arabic-text-breaks-in-browser-pdfs-and-how-to-fix-it-100-client-side-7c3</guid>
      <description>&lt;p&gt;If you have ever tried generating an Arabic PDF in the browser using standard JavaScript libraries—or tried copying Arabic text out of a PDF—you have probably seen two frustrating bugs:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Letters are disconnected and reversed (&lt;code&gt;م ر ح ب ا&lt;/code&gt; instead of &lt;code&gt;مرحبا&lt;/code&gt;).&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Mixed Arabic and English lines scramble the reading order.&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;When building &lt;a href="https://careerpdf.com/en/" rel="noopener noreferrer"&gt;CareerPDF&lt;/a&gt;—a suite of 28 client-side resume, ATS, and PDF tools in Arabic and English that runs entirely in the browser with zero server uploads—solving real-text Arabic PDF generation and extraction was our biggest engineering hurdle.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why PDFs Break Arabic Text
&lt;/h2&gt;

&lt;p&gt;Unlike HTML, a PDF file is not a flow layout document with automatic bidirectional (BiDi) text shaping. A PDF content stream places individual glyph IDs at explicit &lt;code&gt;(x, y)&lt;/code&gt; coordinates from left to right.&lt;/p&gt;

&lt;p&gt;When poorly configured PDF generators write Arabic text—or when you copy Arabic text out of an existing PDF—three things go wrong:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Unicode Presentation Forms (&lt;code&gt;U+FB50&lt;/code&gt;–&lt;code&gt;U+FEFF&lt;/code&gt;):&lt;/strong&gt; Instead of storing base Arabic Unicode characters (&lt;code&gt;U+0600&lt;/code&gt;–&lt;code&gt;U+06FF&lt;/code&gt;) in the &lt;code&gt;/ToUnicode&lt;/code&gt; CMap, the PDF maps glyphs to isolated, initial, medial, or final presentation forms. Many ATS parsers fail to normalize these back to searchable base letters.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Visual vs. Logical Order:&lt;/strong&gt; Because PDF drawing instructions place glyphs visually on the line, naive text extractors read the glyphs left-to-right, reversing every Arabic word while keeping English words forward (or reversing the English numbers inside an Arabic sentence).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Broken Ligatures:&lt;/strong&gt; Shared glyph skeletons get split by artificial space characters during text extraction.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  How to Fix Reversed Arabic Text Copied from a PDF
&lt;/h2&gt;

&lt;p&gt;If you already copied broken Arabic text from a PDF, you can repair it in JavaScript in three steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;NFKC Unicode Normalization:&lt;/strong&gt; Convert all Arabic Presentation Forms-A and Forms-B back into standard base letters using &lt;code&gt;text.normalize('NFKC')&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;BiDi Run Splitting:&lt;/strong&gt; Split each line into directional runs (Arabic RTL runs vs. Latin/Number LTR runs). Reverse the visual order of the Arabic runs while preserving the LTR order of embedded English words and numbers.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Rejoin Split Skeletons:&lt;/strong&gt; Collapse artificial spaces inserted between connecting Arabic letters.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;We packaged this exact pipeline into a free, client-side &lt;a href="https://careerpdf.com/en/fix-arabic-pdf-text/" rel="noopener noreferrer"&gt;Arabic PDF Text Fixer&lt;/a&gt; (&lt;a href="https://careerpdf.com/ar/fix-arabic-pdf-text/" rel="noopener noreferrer"&gt;مصلح النص العربي من PDF&lt;/a&gt;) that repairs broken text directly in your browser.&lt;/p&gt;

&lt;h2&gt;
  
  
  Generating Real-Text, ATS-Readable Arabic Resumes in the Browser
&lt;/h2&gt;

&lt;p&gt;To generate Arabic resumes (&lt;code&gt;https://careerpdf.com/ar/resume-builder/&lt;/code&gt;) that copy back cleanly and parse accurately in Applicant Tracking Systems (ATS):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Embed a proper OpenType Arabic font with complete &lt;code&gt;/ToUnicode&lt;/code&gt; tables mapping shaped glyphs back to standard base Unicode codepoints.&lt;/li&gt;
&lt;li&gt;Run BiDi reordering and contextual shaping in a Web Worker before placing glyphs, while keeping the underlying text layer in logical reading order.&lt;/li&gt;
&lt;li&gt;Verify the output directly in the browser using a client-side PDF parser (&lt;a href="https://careerpdf.com/en/ats-resume-checker/" rel="noopener noreferrer"&gt;ATS Resume Checker&lt;/a&gt;) so users can see the exact raw text an ATS extracts.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Everything runs locally in the browser with zero external network requests—monitored live by a &lt;code&gt;PerformanceObserver&lt;/code&gt; privacy meter on every page.&lt;/p&gt;

&lt;p&gt;Check out the tools here: &lt;a href="https://careerpdf.com/en/" rel="noopener noreferrer"&gt;https://careerpdf.com/en/&lt;/a&gt; (and in Arabic at &lt;a href="https://careerpdf.com/ar/" rel="noopener noreferrer"&gt;https://careerpdf.com/ar/&lt;/a&gt;).&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>pdf</category>
      <category>arabic</category>
    </item>
  </channel>
</rss>
