今日已更新 412 条资讯 | 累计 19972 条内容
关于我们

标签:#pdf

找到 12 篇相关文章

AI 资讯

Why Arabic text comes out backwards when you extract it from a PDF (and how to fix it)

If you've ever built a feature that extracts text from PDFs, an Arabic-speaking user has probably filed this bug: "the words come out in reverse order." Not the letters — the words . Every line reads last-word-first. I spent the better part of a year fixing this class of bugs while building Confileo , a free PDF toolkit with first-class Arabic support. Here's what's actually going on, because almost every explanation online is wrong or incomplete. The four distinct failure modes People say "Arabic breaks" as if it's one bug. It's four: 1. Visual vs logical order (the reversed-words bug) A PDF doesn't store text the way a Word file does — it stores positioned glyph runs : "paint these shapes at these coordinates." For left-to-right scripts, the paint order happens to match the reading order, so naive extraction works by accident. Arabic is right-to-left. Many PDF generators emit the glyph runs in visual order — the order they appear on screen, left to right. A naive extractor concatenates the runs as stored and produces every line word-reversed. The text was never "reversed" in the file; your extractor just assumed paint order == reading order. Fix: reconstruct logical order using glyph positions + the Unicode Bidirectional Algorithm (UAX #9), not the content-stream order. Libraries like PyMuPDF already return text in logical order — a common mistake is "fixing" that output by reversing it again, which is how you get double-reversed text. Rule of thumb: never reverse Arabic yourself. If it looks backwards, your rendering layer lacks bidi support; the data is usually fine. 2. Disconnected letters (the ransom-note bug) Arabic letters are contextual: ع renders differently in initial, medial, final and isolated positions, and letters join. That joining is applied at render time by a shaping engine (HarfBuzz being the standard). If any step of your pipeline round-trips text through a non-shaping renderer — a canvas library, a barebones PDF writer, an image caption filter

2026-07-04 原文 →
AI 资讯

2026 PDF Generation API Comprehensive Comparison Review: 13 Mainstream Solutions Benchmarked (HTML to PDF)

By 2026, the PDF generation API market has evolved from "can it generate" to "does it generate well, fast, and securely." There are over 20 solutions on the market, ranging from a few euros per month for lightweight APIs to enterprise-grade SDKs, with price differences exceeding 100x. This article provides a horizontal comparison of 13 mainstream PDF Generation APIs across six core dimensions — rendering quality, developer experience, performance & stability, data security, pricing, and additional features — to help technical teams make optimal selections. 💡 If you're evaluating PDF generation solutions, check out ComPDF Generation API for an enterprise-grade PDF SDK that integrates viewing, editing, generation, and conversion in one package. Participating Products Overview Product Company/Background Core Positioning Starting Price (Official) ComPDF Generation API PDF Technologies (KDAN) Enterprise PDF Generation SDK + API Free 200 requests/month PDFGeneratorAPI Actual Reports (Estonia) Enterprise Document Automation €80/year (50 credits) CraftMyPDF Independent Team (Singapore) Drag-and-Drop Template Editor $0/month (50 PDFs) DocRaptor Expected Behavior (USA) Highest CSS Fidelity (PrinceXML) Free (5 watermarked docs/month), $15/month Orshot Independent Team Templates + API, supports images & video 30 free, $39/month APITemplate.io Independent Team Visual + HTML Dual Editor $0/month (50 PDFs), $19/month PDFMonkey Independent Team (France) Lightweight HTML Templates €0/month (20 docs), €5/month PDFShift Independent Team Minimalist HTML-to-PDF 50 free requests/month Api2Pdf Independent Team Pay-per-use, no monthly fee $1/month + usage IronPDF Iron Software (USA) .NET Ecosystem PDF Library $749/year Nutrient DWS Nutrient (formerly PSPDFKit) PDF Generation API 50 free requests/month Apryse Apryse (formerly PDFTron) Enterprise PDF SDK Contact sales (starting from $1,500) Adobe Document Generation API Adobe Cloud Document Generation Usage-based pricing Six-Dimension In-Dep

2026-06-26 原文 →
AI 资讯

Why HTML-to-PDF Breaks in Production (and What to Use Instead)

Almost every "generate a PDF" feature starts the same way. You already have HTML. You already have CSS. So you reach for the obvious move: render the page, screenshot it to PDF, ship it. Puppeteer, Playwright, wkhtmltopdf, a hosted "HTML to PDF API" — pick your flavor. In an afternoon you have an invoice coming out the other end and it looks fine. Then it goes to production. And "fine" slowly turns into a backlog of weird, hard-to-reproduce bugs. This is not an argument that HTML-to-PDF is useless. For a one-off export or an internal report, it's great. The argument is narrower: the moment PDF generation becomes a real, automated, customer-facing part of your product, "screenshot a web page" is the wrong abstraction — and the failure modes are predictable enough to list in advance. The core problem: a PDF is not a web page A browser renders for an infinite, scrollable, single-width viewport. A PDF is a stack of fixed, finite, printable pages. Those are different physics. HTML-to-PDF works by rendering your page in a headless browser and then slicing that continuous render into page-sized pieces. Everything that's hard about it comes from that one mismatch: you designed for a stream, and now you're forcing it into pages. Most of the bugs below are just that mismatch showing up in different costumes. Failure mode 1: pagination This is the big one. A browser has no concept of "page 2." So when your content is taller than one page, the engine has to guess where to cut — and it cuts wherever the pixel ruler lands. That means: a table row sliced in half across the page break a heading stranded alone at the bottom of a page, its content on the next a total row that floats away from the table it belongs to a signature block split from the line above it CSS has break-inside: avoid , break-before , and friends — and they help. But support is uneven across engines, they interact badly with flex/grid, and you end up hand-tuning rules per document until it looks right for the da

2026-06-26 原文 →
AI 资讯

How I Split PDFs in the Browser with Vue 3 and pdf-lib

Splitting a PDF is one of those features that sounds trivial until you try to build it. Users expect range input ( 1-3, 5, 7-9 ), a per-page option, multiple file downloads, and zero server involvement. I built en.sotool.top/split/ to do exactly that. Here's how it works with Vue 3 and pdf-lib . Why Client-Side? PDFs often contain sensitive information. Contracts, medical records, financial statements. Even a "simple" splitting tool should not force users to upload files to a server. Client-side benefits: No upload bandwidth or size limits No server storage or cleanup Instant processing for normal files Works offline after the page loads The tradeoff is that everything has to run in the browser, which limits the libraries you can use. The Stack Vue 3 — UI and state pdf-lib — Load, manipulate, and save PDFs File API — Read the uploaded file lucide-vue-next — Icons npm install pdf-lib Loading the PDF and Counting Pages First, read the file into an ArrayBuffer and load it with pdf-lib . import { PDFDocument } from ' pdf-lib ' const pdfFile = ref < File | null > ( null ) const totalPages = ref ( 0 ) async function handleFile ( files : File []) { if ( files . length === 0 ) return pdfFile . value = files [ 0 ] const bytes = await files [ 0 ]. arrayBuffer () const pdf = await PDFDocument . load ( bytes ) totalPages . value = pdf . getPageCount () } Now we know how many pages exist and can show the split UI. Two Split Modes I offer two ways to split: by range and per page. Mode 1: Page Range Input Users type something like 1-3, 5, 7-9 . I parse it into groups of page indices. function parseRanges ( input : string , max : number ): number [][] { const groups : number [][] = [] const parts = input . split ( ' , ' ). map ( s => s . trim ()) for ( const part of parts ) { if ( part . includes ( ' - ' )) { const [ start , end ] = part . split ( ' - ' ). map ( Number ) const pages = [] for ( let i = start ; i <= end && i <= max ; i ++ ) { pages . push ( i - 1 ) } if ( pages . len

2026-06-25 原文 →
AI 资讯

fulgur-chart: deterministic SVG/PNG from Chart.js JSON, without JavaScript

A new member has joined the fulgur family. fulgur-chart — a CLI that takes Chart.js v4-compatible JSON specs and renders deterministic SVG/PNG charts. No browser required. https://github.com/fulgur-rs/fulgur-chart Two things make it different: it doesn't spin up a browser, and for a fixed version, font, and rendering options, the same JSON input always produces byte-identical output. This post covers why I built it, a timing coincidence that made me feel like I was on the right track, and how to use it. Why I wanted graphs in PDFs fulgur and fulgur-chart are built around one idea: AI agents should be able to generate documents that look good . There are three steps to that argument. First, Markdown isn't expressive enough. For client-facing reports, plain Markdown often undersells otherwise strong content. Second, visual quality is persuasive. A well-formatted report lands differently than a wall of text. Third — and this is the one I keep coming back to — in many business workflows, PDF carries more institutional weight than a Markdown file or a transient web page . That authority has two dimensions. There's a cognitive one: PDFs read as "serious documents." Proposals, reports, invoices — the format itself signals credibility. And there's a technical one: PDF can support digital signatures, encryption, and archival profiles such as PDF/A. That's the ground flpdf covers, a pure-Rust PDF toolkit modeled on qpdf's workflow. So the goal is always PDF, not HTML, not a web page. That's what fulgur is for. And a polished report needs charts. But Markdown can't draw charts. Which brings me to a problem I already knew was coming: the Chart.js library requires JavaScript to run . fulgur has no browser and no JS runtime, so there was no path to running Chart.js directly. The design choice: no JS engine The obvious alternative was to embed a JavaScript runtime. I could either run Chart.js with a compatible Canvas implementation, or build a JavaScript renderer that consumes Cha

2026-06-24 原文 →
AI 资讯

Detect AI-Generated PDFs: What Works and What Does Not

Originally published at htpbe.tech . The version on htpbe.tech stays in sync with the latest detection algorithm — refer to it for the canonical text. Accounts payable teams are receiving receipts generated by ChatGPT plugins. HR platforms are seeing payslips rendered by Python scripts. Insurance claims contain repair estimates that no shop ever issued. The documents look correct. The logos match. The numbers are plausible. The question is: what can actually be detected, and what cannot? The honest answer requires separating two things that are often confused under the phrase “AI-generated document detection.” Two distinct problems called "AI-generated document detection" When people ask how to detect an AI-generated document, they usually mean one of two distinct things: Content classification asks: was the text in this document written by an AI language model? This is what tools like GPTZero and Turnitin’s AI detector do. They analyze writing style, token probability distributions, and linguistic patterns to estimate whether a human or a model produced the text. Structural forensics asks: was this PDF file generated by a real institutional system, or did it come from a headless browser, a PDF library, or a consumer tool? This is what HTPBE does. It reads the binary structure of the file — producer metadata, xref patterns, font embedding, object numbering — and checks whether those patterns match how legitimate institutional software generates documents. These are not the same problem. A document can contain AI-written text and still come from a real corporate system. A document can contain entirely human-written text and still have been rendered by Puppeteer an hour ago. The structural check and the content check answer different questions. HTPBE does structural forensics. It does not classify text. This article explains what that distinction means in practice, what the structural approach reliably catches, and where its limits are. What structural forensics detec

2026-06-22 原文 →
开发者

PDF API is live on Forgelab

We just shipped the Forgelab PDF API — a fast, affordable REST API for developers who need to handle PDF files without the hassle. What it does: Merge multiple PDFs into one Split PDFs by page ranges Compress PDFs to reduce file size Convert PDFs to images (PNG/JPEG) Pricing: Starts at $5/month for 100 calls/month. No hidden fees. Quick start: curl -X POST https://www.forgelab.africa/api/pdf/merge \ -H "X-API-Key: your_key" \ -F "files=@doc1.pdf" -F "files=@doc2.pdf" Sign up at forgelab.africa

2026-06-22 原文 →
AI 资讯

How to Convert Word to PDF in the Browser with Vue 3, mammoth, and html2pdf.js

Converting Word documents to PDFs on the server is the classic approach: upload the file, run LibreOffice or a cloud API, send the result back. But that means your users’ resumes, contracts, and reports touch your infrastructure. I wanted something simpler for en.sotool.top : pick a .docx file in the browser, preview the parsed content, and download a PDF. No server involved. Here is how I built it with Vue 3, mammoth , and html2pdf.js . Why Client-Side? The main reason is privacy. Resumes, contracts, tax documents — users do not want them on a stranger’s server. Client-side conversion also means: No upload bandwidth limits No file size caps from your server No storage to clean up Works offline after the page loads The trade-off is that very complex documents are limited by the browser’s rendering capabilities. For typical office documents, that is fine. The Stack Vue 3 — UI, file handling, and reactive state mammoth — Parse .docx files into clean HTML html2pdf.js — Render the HTML into a PDF using html2canvas + jsPDF Native File API — File selection npm install mammoth html2pdf.js Loading the Word Document The first step is reading the uploaded .docx file into an ArrayBuffer , then converting it to HTML with mammoth . import mammoth from ' mammoth ' ; async function convertDocxToHtml ( file ) { const arrayBuffer = await file . arrayBuffer (); const result = await mammoth . convertToHtml ({ arrayBuffer }); return result . value ; } mammoth intentionally produces simple, clean HTML. It ignores complex formatting like text boxes and embedded fonts, which makes the output predictable. I keep the HTML in a reactive ref and render it in a preview panel: < template > <div ref= "previewRef" class= "word-preview" v-html= "htmlContent" ></div> </ template > < script setup > import { ref } from ' vue ' ; const htmlContent = ref ( '' ); const previewRef = ref ( null ); </ script > Generating the PDF Once the user is happy with the preview, html2pdf.js turns the preview element

2026-06-13 原文 →
AI 资讯

Why Building a PDF Engine in Go Will Help You Understand Go Concepts Better

There is a class of projects that teaches you more about a language than any tutorial ever could. Building a PDF engine from scratch in Go is one of them. It is not glamorous. It is not trendy. But it forces you to confront memory management, binary serialization, concurrency safety, interface design, and performance profiling all at once, in a domain where correctness is non-negotiable. This article walks through the lessons learned building GoPdfSuit (~500 Github ⭐), a production PDF engine written in Go that generates 1.5 million financial PDFs in roughly 45 minutes on a single node, achieves PDF/A-4 and PDF/UA-2 compliance, and exposes itself as a REST API, a Go library, and Python CGO bindings simultaneously. Note : While I have six years of overall experience including two years working specifically with Go, I rarely encountered these types of challenges in my day-to-day work, as my role focused primarily on implementing new features within an existing architecture. Working on gopdfsuit was an excellent learning experience; it allowed me to dive deep into performance optimization and taught me a great deal. Below are some of the key takeaways. Building GoPdfSuit from a blank editor to a production-grade PDF engine-one that ships PDF 2.0 , PDF/A-4 , PDF/UA-2 , PKCS#7 signing, merge/split, XFDF fill, secure redaction, and a public gopdflib API-forced a shift from “business logic” to “systems engineering.” When you chase ~2,000+ aggregate ops/s on a mixed financial workload (48 workers, PDF/A on) and sub ~10 ms PDF generation, you stop debating frameworks and start fighting the allocator, cache lines, and ISO 32000 semantics. These fifty lessons are drawn from the actual codebase ( internal/pdf , pkg/gopdflib , benchmark harnesses under sampledata/ , and documented optimization passes in guides/cursor/ ). They mix specification pain with Go runtime craft and production reality-not generic blog advice. Part 1: Structural Hurdles & PDF Specification Nightmares Deco

2026-06-08 原文 →
AI 资讯

I built a small tool to make PDFs easier to read at night

I read a lot of PDFs at night, especially on my phone. And honestly, PDFs are not great for that. Most of them still feel like digital paper: white background, fixed layout, and tiny text. Dark mode helps a bit, but many tools only change the page color. The bigger problem for me was mobile reading. When the text is too small, I have to pinch zoom, move the page left and right, zoom out again, then repeat the same thing on the next paragraph. After doing that too many times, I thought: Why can’t I just read the PDF text like an article? So I built a small free tool: PDF Dark Mode It has two reading modes. Page color mode This keeps the original PDF layout, but makes the page darker and easier to read at night. I use this for scanned PDFs, tables, image-heavy documents, or files where the original layout matters. Text reading mode For selectable PDFs, the tool can extract the text and show it in a cleaner reading view. You can adjust the font size, line height, font family, and theme. This is the part I personally wanted most, because it makes mobile reading much more comfortable. Instead of constantly pinch-zooming a fixed PDF page, the PDF starts to feel more like a normal article. Privacy The tool runs locally in the browser. Your PDF is not uploaded to a server, and refreshing the page clears the current session. Try it You can try it here: PDF Dark Mode I built it for my own night reading, but I’d love to hear feedback from anyone who reads PDFs on mobile. Also, if you ever need to convert a dark PDF back to a light version, I made a related tool for that too: PDF Light Mode

2026-06-02 原文 →
AI 资讯

I Built pretext-pdf: Serverless PDFs Without Chromium

I Built pretext-pdf: Serverless PDFs Without Chromium I got frustrated with PDF generation in Node.js. Every tool had trade-offs, and none of them felt right. The Problem Every time I needed to generate PDFs programmatically, I hit the same walls: Puppeteer — Renders HTML to PDF beautifully, but takes 500ms-2s per page. Way too slow for batch operations. wkhtmltopdf — Old, fragile, breaks in production, dependency hell. pdfmake — Good for simple invoices, falls apart with complex layouts. All of them — Overkill if you're not rendering HTML. And here's the kicker: I didn't need to render HTML. I had structured data (invoices, reports, certificates) that I needed to turn into PDFs programmatically . The Solution I built pretext-pdf — a JSON-based PDF generation library. Instead of: javascript // ❌ Puppeteer: render HTML const browser = await puppeteer.launch(); const page = await browser.newPage(); await page.setContent(html); const pdf = await page.pdf(); // 1000ms+ You do: // ✅ pretext-pdf: define structure const doc = { sections: [ { type: 'heading', text: 'Invoice' }, { type: 'table', rows: [...] } ] }; const pdf = await renderPDF(doc); // 40-100ms No Chromium. No external dependencies. Pure Node.js. Why This Matters If you're building: ✅ Invoice generation systems ✅ Dynamic reports for your SaaS ✅ AI agents that create PDFs (Claude, Cursor, Windsurf) ✅ Certificate systems ✅ Multi-language documents ...pretext-pdf is built for you. Today: v2.0.14 Launch I just shipped a major upgrade. The text layout engine (which handles how words break across lines) is now significantly better: Better CJK + Latin mixed-script handling Smarter punctuation (quotes stay with their text) 7-12% faster Zero breaking changes The Stats 337 tests passing — production-ready 0 critical vulnerabilities — secure MIT licensed — free to use Open source — contribute or fork Technical Foundation The layout engine is based on pretext by Cheng Lou (React core team). I cherry-picked 11 patches for

2026-05-31 原文 →
AI 资讯

I Needed to Remove a QR Code from an Image, But Every Solution Was Complicated

A few weeks ago, I was updating some marketing assets for one of my projects. Everything looked good until I noticed a small problem. The image contained an old QR code. The QR code was pointing to an outdated page, and I needed to remove it before publishing the image again. My first thought was, "This should be easy." I opened a few image editing tools and quickly realized it wasn't as simple as I expected. Most solutions required installing software, learning editing techniques, or manually covering the QR code with another object. Some AI tools could do it, but they were either paid or required creating an account. For a task that should take a few seconds, I was spending far too much time. That's when I started wondering: "Why isn't there a simple tool that only removes QR codes?" The Problem With QR Codes QR codes are everywhere. They're on flyers, product images, posters, presentations, screenshots, and social media graphics. The problem is that QR codes don't always stay relevant. Businesses change landing pages. Campaigns expire. Links break. Sometimes you simply want to reuse an image without the QR code. Yet removing one often requires using software designed for professional designers. Building a Simpler Solution Instead of continuing to search for a solution, I decided to build one. The goal was simple: Upload an image Detect QR codes automatically Remove them Download the cleaned result No accounts. No complicated editing. No learning curve. Just a tool that solves one problem well. After several iterations, the result became the Remove QR Code tool on ConvertKR. What I Learned One thing I've learned from building developer tools is that users don't always need more features. Sometimes they just need fewer steps. The best tools are often the ones that remove friction from a small but frustrating task. Removing a QR code is not something people do every day. But when they need it, they want the process to be fast. Try It Yourself If you've ever found yo

2026-05-30 原文 →