<?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: lilucpp</title>
    <description>The latest articles on DEV Community by lilucpp (@lu_li_7ccf242b0e640479ed4).</description>
    <link>https://dev.to/lu_li_7ccf242b0e640479ed4</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%2F4275485%2Fdd00061e-c208-47e8-9309-ea4028f6decc.jpeg</url>
      <title>DEV Community: lilucpp</title>
      <link>https://dev.to/lu_li_7ccf242b0e640479ed4</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/lu_li_7ccf242b0e640479ed4"/>
    <language>en</language>
    <item>
      <title>DocToText-enh: Fast C/C++ Document &amp; OCR Extractor (No JVM)</title>
      <dc:creator>lilucpp</dc:creator>
      <pubDate>Tue, 01 Dec 2026 05:21:20 +0000</pubDate>
      <link>https://dev.to/lu_li_7ccf242b0e640479ed4/doctotext-enh-fast-cc-document-ocr-extractor-no-jvm-3iop</link>
      <guid>https://dev.to/lu_li_7ccf242b0e640479ed4/doctotext-enh-fast-cc-document-ocr-extractor-no-jvm-3iop</guid>
      <description>&lt;p&gt;When building RAG or document search pipelines, heavy JVM or Python-only parsers often become the bottleneck in cold-start latency and RAM usage.&lt;/p&gt;

&lt;p&gt;I have been maintaining and upgrading the classic SILVERCODERS DocToText C/C++ library under &lt;strong&gt;DocToText-Enhanced (DocToText-enh)&lt;/strong&gt;, keeping it dependency-light (no JVM or Python runtime required) while modernizing layout extraction and FFI stability.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;GitHub: &lt;a href="https://github.com/lilucpp/doctotext" rel="noopener noreferrer"&gt;https://github.com/lilucpp/doctotext&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Docs &amp;amp; Benchmarks: &lt;a href="https://lilucpp.github.io/doctotext/" rel="noopener noreferrer"&gt;https://lilucpp.github.io/doctotext/&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  What Is Enhanced Over Original DocToText
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;PDF Reading Order &amp;amp; Completeness&lt;/strong&gt;: Orders multi-column text and formula baselines by page coordinates, removes repeated footers, and extracts PDF attachments, annotations, and form fields.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Decoupled Image &amp;amp; OCR Callback&lt;/strong&gt;: No bundled vision bloat. Dispatches standalone images or embedded graphics (JPEG, PNG, BMP, JBIG2, CCITT G3/G4) to your own Tesseract, PaddleOCR, or ONNX callback and stitches text back in reading order—with dual-layer PDF deduplication and scan fallback.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Recursive Embedded Documents&lt;/strong&gt;: Extracts documents nested inside DOC, DOCX, XLS, XLSX, PPT, PPTX, ODF, RTF, and PDF with recursion-depth and size guards.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Stable C ABI First&lt;/strong&gt;: Pure C interface (&lt;code&gt;doctotext_c_api.h&lt;/code&gt;) avoids C++ ABI mismatches across compilers and works directly from Python &lt;code&gt;ctypes&lt;/code&gt;, Go, Rust, and C#.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Linux &lt;code&gt;$ORIGIN&lt;/code&gt; Portable Builds&lt;/strong&gt;: Relocatable binaries and shared libraries out of the box without configuring &lt;code&gt;LD_LIBRARY_PATH&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Measured Comparison (1,000 Mixed Documents, 64.79 MB)
&lt;/h3&gt;

&lt;p&gt;Measured on Ubuntu Linux (AMD Ryzen 7 PRO 4750U, 16 threads) with external image OCR disabled across all engines (Apache Tika 1.28.5 run in warm single-JVM &lt;code&gt;--server&lt;/code&gt; mode with &lt;code&gt;TesseractOCRParser&lt;/code&gt; excluded):&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Mode&lt;/th&gt;
&lt;th&gt;Engine&lt;/th&gt;
&lt;th&gt;Time&lt;/th&gt;
&lt;th&gt;Throughput&lt;/th&gt;
&lt;th&gt;Peak Physical Memory&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Single-Thread&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;DocToText-enh (C API)&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;1.704 s&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;38.01 MB/s (586.7 files/s)&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;26.7 MB&lt;/strong&gt; (incl. 16.5 MB Python host)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Single-Thread&lt;/td&gt;
&lt;td&gt;Apache Tika (Warm JVM)&lt;/td&gt;
&lt;td&gt;21.245 s&lt;/td&gt;
&lt;td&gt;3.05 MB/s (47.1 files/s)&lt;/td&gt;
&lt;td&gt;1,015.1 MB&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;8-Way Concurrency&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;DocToText-enh (8 Workers)&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;0.538 s&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;120.43 MB/s (1,858.7 files/s)&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;174.6 MB total&lt;/strong&gt; (≤ 23.2 MB / worker)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;8-Way Concurrency&lt;/td&gt;
&lt;td&gt;Apache Tika (8 Threads)&lt;/td&gt;
&lt;td&gt;6.397 s&lt;/td&gt;
&lt;td&gt;10.13 MB/s (156.3 files/s)&lt;/td&gt;
&lt;td&gt;1,523.3 MB&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Single cold-start DOCX (2.08 MB): &lt;strong&gt;7.9 ms / 7.3 MB RAM&lt;/strong&gt; (vs. 1,747.8 ms / 171.5 MB for Tika CLI, and 124.7 ms / 36.9 MB for &lt;code&gt;python-docx&lt;/code&gt;).&lt;/p&gt;

&lt;p&gt;Licensed under &lt;strong&gt;GPL-2.0&lt;/strong&gt;. Feedback and test cases are welcome!&lt;/p&gt;

</description>
      <category>cpp</category>
      <category>c</category>
      <category>rag</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
