Pagecraft

metadata

Edit PDF metadata

Change or remove what a document says about its author and its software.

Reads
a PDF — application/pdf
Writes
one file — PDFs
Tool page
/edit-pdf-metadata

Example

Give a file the title a library catalogue will show instead of its filename.

Given

  • report.pdf — an ordinary PDF of 2 pages

From code

            import { loadDocument, runOperation } from '@pagecraft/core';

const report = await loadDocument({ bytes, name: 'report.pdf' });

const [output] = await runOperation('metadata', [report], {
  title: 'Quarterly report',
  author: 'Priya Nair',
  keywords: 'accounts, 2026',
});
          

From a shell

            pagecraft metadata report.pdf --title 'Quarterly report' --author 'Priya Nair' --keywords 'accounts, 2026'
          

What comes back

One PDF of 2 pages.

This example is run by the test suite. If it stopped being true, the build would fail.

Options

strip--strip

boolean

Remove all metadata

Takes off the title, author, subject, keywords, the software that produced the file, both timestamps and the whole XMP packet, including any revision history.

Default: false

title--title

string

Title

What a reader shows in its window and its tab.

Only when strip is off.

author--author

string

Author

Leave empty to remove it.

Only when strip is off.

subject--subject

string

Subject

One line about what the document is.

Only when strip is off.

keywords--keywords

string

Keywords

Separated by commas.

Only when strip is off.

creator--creator

string

Created with

The application the document was written in.

Only when strip is off.

producer--producer

string

Produced by

The software that wrote the PDF itself.

Only when strip is off.

What it cannot do

  • A field left blank is left as it is. To remove one, give it as empty — a form that clears the box, or --author "" on the command line.
  • The two timestamps can be kept or removed, not set. A document that claims to have been written at a time it was not is worse than one that does not say.
  • Metadata is what the file says about itself. A name printed on page one is content: use Redact for that.
  • XMP properties are matched by the usual dc:, xmp: and pdf: prefixes. A packet that declares those namespaces under other prefixes keeps its own copy, and the two may then disagree.