<?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: Shuai Shao</title>
    <description>The latest articles on DEV Community by Shuai Shao (@shuai_shao_dd9f1005d0156c).</description>
    <link>https://dev.to/shuai_shao_dd9f1005d0156c</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.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1541718%2F29c2ac70-e75d-4bc7-9af0-4d2142f8097b.jpg</url>
      <title>DEV Community: Shuai Shao</title>
      <link>https://dev.to/shuai_shao_dd9f1005d0156c</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/shuai_shao_dd9f1005d0156c"/>
    <language>en</language>
    <item>
      <title>Why I Built a 100% Offline AI Tool (PySide6 + Microsoft Presidio) to Permanently Redact PDFs</title>
      <dc:creator>Shuai Shao</dc:creator>
      <pubDate>Mon, 25 May 2026 08:26:47 +0000</pubDate>
      <link>https://dev.to/shuai_shao_dd9f1005d0156c/why-i-built-a-100-offline-ai-tool-pyside6-microsoft-presidio-to-permanently-redact-pdfs-k37</link>
      <guid>https://dev.to/shuai_shao_dd9f1005d0156c/why-i-built-a-100-offline-ai-tool-pyside6-microsoft-presidio-to-permanently-redact-pdfs-k37</guid>
      <description>&lt;p&gt;As developers, we handle tons of sensitive data every day—API keys, legal contracts, financial statements, and user metrics. A few months ago, I needed to redact some Personally Identifiable Information (PII) from a batch of PDF documents.&lt;/p&gt;

&lt;p&gt;I looked into existing online tools, but they all required one terrifying thing: &lt;strong&gt;uploading confidential files to their cloud servers.&lt;/strong&gt; For anyone handling HIPAA, GDPR, or corporate legal data, that's an absolute dealbreaker. Even worse, many standard PDF editors only place a black vector box &lt;em&gt;over&lt;/em&gt; the text, leaving the underlying sensitive data completely scrapable.&lt;/p&gt;

&lt;p&gt;So, I spent the last 2 months building a local-first, privacy-focused desktop app to solve this permanently: &lt;strong&gt;PII Blackout&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Here is how I built it, the tech stack behind it, and the engineering challenges I faced.&lt;/p&gt;




&lt;h2&gt;
  
  
  🛠️ The Tech Stack &amp;amp; Architecture
&lt;/h2&gt;

&lt;p&gt;I wanted the app to be cross-platform, highly performant, and capable of running heavy AI inference locally without breaking a sweat.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;GUI Framework:&lt;/strong&gt; &lt;code&gt;PySide6&lt;/code&gt; (Qt for Python). It provides native desktop performance and smooth UI rendering, which is essential for handling massive PDF files.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Core PII Engine:&lt;/strong&gt; Powered by &lt;strong&gt;Microsoft's Presidio architecture&lt;/strong&gt;. I chose Presidio because of its extensible orchestrator design, which allowed me to easily combine rule-based pattern matchers (Regex) with advanced NER models (like &lt;code&gt;GLiNER&lt;/code&gt;). This combination ensures the app intelligently auto-detects names, emails, phone numbers, and physical addresses out of the box with production-grade accuracy.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;PDF Processing:&lt;/strong&gt; Custom backend that flattens and burns the blackouts directly into the image layer of the document, making it mathematically impossible to recover or reverse-engineer the redacted data.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🛡️ Core Engineering Challenges
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Adapting Microsoft Presidio for Local Execution
&lt;/h3&gt;

&lt;p&gt;Microsoft Presidio is fantastic, but it's often deployed as a cloud service or containerized API. Adapting its architecture to run entirely inside a local Python client environment required optimizing the loading times of the underlying AI models and managing memory efficiently.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;💡 &lt;em&gt;Lesson learned:&lt;/em&gt; A minimum of &lt;strong&gt;12GB RAM&lt;/strong&gt; is the sweet spot for smooth local AI processing when parsing multi-page documents simultaneously.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  2. Destructive Redaction vs. Lazy Masking
&lt;/h3&gt;

&lt;p&gt;Many PDF tools just change the background color of the text to black. If you copy-paste that section, the hidden text is revealed. &lt;strong&gt;PII Blackout&lt;/strong&gt; completely flattens the document architecture, destroying the sensitive data layers and rendering them as a unified image layer.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Batch Processing Optimization
&lt;/h3&gt;

&lt;p&gt;To make it useful for professionals, I implemented a drag-and-drop batch processing system. Users can drop an entire folder of hundreds of PDFs, and the app will queue and redact them locally in seconds.&lt;/p&gt;




&lt;h2&gt;
  
  
  🚀 Check it out (and Feedback Welcome!)
&lt;/h2&gt;

&lt;p&gt;I've just officially released &lt;strong&gt;v1.0.2&lt;/strong&gt; and would love to get the DEV community's feedback on the UI/UX and the local performance.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Official Web:&lt;/strong&gt; &lt;a href="https://piiblackout.com" rel="noopener noreferrer"&gt;piiblackout.com&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;GitHub Releases:&lt;/strong&gt; &lt;a href="https://github.com/shaoshuaithe/PII-Blackout/releases" rel="noopener noreferrer"&gt;PII-Blackout/releases&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Windows Download:&lt;/strong&gt; &lt;a href="https://download.piiblackout.com/Windows/PIIBlackout_Setup_Latest.exe" rel="noopener noreferrer"&gt;Direct Setup Link (.exe)&lt;/a&gt; or via &lt;a href="https://apps.microsoft.com/detail/9NDX87GLKV5N" rel="noopener noreferrer"&gt;Microsoft Store&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Quick Workflow Demo:&lt;/strong&gt; &lt;a href="https://youtu.be/brz8OjOWYkI" rel="noopener noreferrer"&gt;Watch on YouTube&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  🎁 Free Tier for Developers &amp;amp; Solo Users
&lt;/h3&gt;

&lt;p&gt;The free tier lets you process up to 3 PDFs per day (max 15 pages per document, with a light watermark). If you need heavy enterprise usage, there are Pro tiers available too.&lt;/p&gt;

&lt;p&gt;If you are familiar with Microsoft Presidio, building local-first AI tools, or working with PySide6, let's connect in the comments! How are you handling PII security in your own workflows?&lt;/p&gt;

</description>
      <category>privacy</category>
      <category>python</category>
      <category>pdf</category>
      <category>security</category>
    </item>
  </channel>
</rss>
