toolgarden.xyz
中文

Edit PDF

Edit a PDF online: rewrite existing text in place, add new text, signature images, pen markup, highlights, and cover boxes, all in your browser.

…

About this tool

PDF was never designed for word-processor editing: a page records "draw these glyphs at these coordinates in this font", with no notion of reflowing paragraphs. So this tool offers two distinct paths — rewrite the text already in the page content stream, or layer new text, signatures, markup, and cover boxes on top. The first keeps the result as real text; the second is not limited by the original font.

To rewrite, the tool extracts each run's raw bytes and position with pdf.js, locates the matching text-showing operator (Tj / TJ) in the page content stream, replaces the string inside it, and writes the file back out with pdf-lib. Annotations are written as native PDF annotation objects (Ink, Square, FreeText, Stamp): vector, tiny, and still selectable or removable in other readers. Both run locally in your browser; the file is never uploaded.

How to use it

  1. Upload the PDF and wait for rendering

    Pages are rendered into a backdrop while text positions are extracted; longer documents take longer.

  2. Rewrite: click the text on the page

    Rewrite mode is the default. Hover a run to outline it, click, type, and press Enter — the page is then re-rendered from the rewritten PDF, so the font and color you see are what gets exported.

  3. Annotate: text, pen, highlight, box, image

    Use the overlay tools for signatures, handwriting, or covering content. They are not limited by the original font; CJK text pulls a font on demand and embeds only the glyphs used, so it stays real text.

  4. Save and download

    Export rewrites the content stream first, then stamps the annotation layer. Anything that could not be rewritten is listed with its reason rather than silently written as blanks.

Supported range and limits

How rewriting works
The Tj / TJ strings in the page content stream are located and replaced, reusing the original font, rather than stamping a layer
Requirements for rewriting
The text must live in the page content stream, use a single-byte font, and every new character needs a glyph in that font
Behavior on failure
The run is skipped and the reason reported while you edit; the tool never writes a PDF that renders as blanks or tofu boxes
Kerning
Kerned segments inside a TJ array are merged into the first piece and the new text is laid out with the font's own widths
Annotation tools
Written as native annotations: pen and highlight as Ink, box as Square, text as FreeText, image as Stamp
Preview
Each edit is applied to the PDF and the page re-rendered, so the preview matches the exported file
Annotation resolution
Vector output, resolution independent; only unknown objects and text without glyphs are rasterised individually
Rotated and cropped pages
Coordinates follow both /Rotate and the crop box, so marks on landscape scans and trimmed print files stay aligned
Where it runs
Rendering, rewriting, annotating, and writing back all happen locally in the browser

When you would use it

  • Correcting a number or date in a formal document

    Fix a wrong amount, quote, or effective date directly in the text so the result stays selectable and searchable with no cover-up visible.

  • Signing and completing a form

    Draw the signature with the pen or insert a transparent signature image, then type the date and name beside it.

  • Reviewing a draft in place

    Highlight the problematic paragraph and write the comment next to it so the note points at something specific.

  • Covering what cannot be regenerated

    When the original font blocks a rewrite, put a filled box over the old content and write the correct text on top.

What to know before you start

  • A rewrite does not reflow: the start position stays put, longer text does not push later content aside, and nothing wraps to a new line.
  • Three cases cannot be rewritten, and each is reported while you edit: the text is not in the page content stream (a form field or Form XObject, for example), the font is a multi-byte CID font, or the original font has no glyph for the new characters — common with subset CJK fonts.
  • A filled box hides content visually only; the covered text stays in the text layer and can still be copied or extracted, so it is not redaction. Use a rewrite when the text must actually go.
  • Exporting rewrites the file, which invalidates an existing digital signature. Remove the password from an encrypted PDF before editing it.

Related concepts

Content stream
The part of a PDF page holding its drawing instructions. Tj and TJ are its text-showing operators, and rewriting replaces the strings they carry.
Font subset
Only the glyphs a document actually uses get embedded. That keeps files small but means characters absent from the original font cannot simply be written in.
/Rotate
A page attribute of 0, 90, 180, or 270 degrees. Readers rotate the displayed page by it while the coordinate system stays put, so annotations must be converted to line up.

Frequently asked questions

Is the PDF uploaded anywhere?
No. The PDF is rendered in your browser and the annotations are written back locally. Nothing is sent to a server.
Can I change the existing text in the PDF?
No. This tool layers text, pen strokes, highlights, and boxes over the page; the original text and layout stay as they are. Edit the source document and re-export when the wording has to change.
How do I sign a PDF?
Draw the signature with the pen tool, or use Insert image to place a signature image with a transparent background, then drag and resize it onto the signature line before saving.
Can it change the text already in the PDF?
Yes, within limits. Pick Rewrite text, click a line, and type: on export the page content stream itself is rewritten, so the result is still real text rather than an image. It requires the text to live in the page content stream, a single-byte font, and a glyph for every new character in the original font — subset CJK fonts often fail, and the tool then says so instead of writing blanks, leaving you the text and cover-box route.
Does rewriting reflow the paragraph?
No. PDF text sits at absolute coordinates with no reflow. A rewrite replaces the characters of that one run; the start position stays, a longer string does not push later text aside, and nothing wraps to a new line.
Are annotations images or vectors?
Vectors. Pen, highlight, box and text are written as native PDF annotations (Ink, Square, FreeText, Stamp), so they stay sharp at any zoom and can still be selected or deleted in Acrobat. Only inserted images — and text whose glyphs are unavailable — are rasterised, and then only that one object.
Why do CJK documents usually refuse to rewrite?
CJK PDFs mostly use CID (Type0) fonts and embed only the glyphs the document actually uses. Bytes do not map one-to-one to characters, and the characters you want to type were probably never embedded. Writing them anyway would render blanks or tofu boxes, so the tool fails the rewrite and points you at the overlay text tool.
How is rewriting different from covering text with a box?
A rewrite changes the text itself: the old characters leave the file and the new ones reuse the original font, staying selectable, copyable, and searchable. A cover box only paints over the page — the old text remains in the text layer and shows up in any copy or extraction.
Why did the file size change?
Rewriting only swaps strings, so size barely moves. Annotations are vector objects — a pen stroke or a box costs a few hundred bytes. Inserted images cost what the image costs, and CJK text adds a font subset holding only the glyphs you typed, a few KB.