how to change pdf metadata on multiple files at once?

  • Follow


Hello,

suppose you have a long list of pdf files and you want to add the same
metadata
(say, Author, subject) to all of them. Is there an utility somewhere
that does it?

Thanks,
Bob

0
Reply catdogbeloved (59) 10/31/2005 8:29:36 AM

Bob wrote:
> Hello,
> 
> suppose you have a long list of pdf files and you want to add the same
> metadata
> (say, Author, subject) to all of them. Is there an utility somewhere
> that does it?

iText (Java) or iTextSharp (.NET) can do this.
You can add regular PDF metadata, XMP metadata or both.

This is some sample code that adds an author and a title,
in the form of both regular and XMP metadata:

PdfReader reader = new PdfReader("HelloWorldNoMetadata.pdf");
PdfStamper stamper = new PdfStamper(reader,
  new FileOutputStream("HelloWorldStampedMetadata.pdf"));
HashMap info = reader.getInfo();
info.put("Author", "Bruno Lowagie");
info.put("Title", "Hello World stamped");
stamper.setMoreInfo(info);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
XmpWriter xmp = new XmpWriter(baos, info);
xmp.close();
stamper.setXmpMetadata(baos.toByteArray());
stamper.close();

br,
Bruno
0
Reply Bruno 10/31/2005 9:07:59 AM


Bob wrote:
> Hello,
> 
> suppose you have a long list of pdf files and you want to add the
> same metadata (say, Author, subject) to all of them. Is there an
> utility somewhere that does it?

pdftk
http://www.accesspdf.com/pdftk/

and a 'for' loop in your shell. (recommended!)

Or
MbtPdfAsm
http://thierry.schmit.free.fr/dev/mbtPdfAsm/enMbtPdfAsm2.html

Or
BeCyPDFMetaEdit (there is also a batch mode):
http://www.becyhome.de/becypdfmetaedit/description_ger.htm

Ralf
0
Reply Ralf 10/31/2005 9:25:38 AM

2 Replies
909 Views

(page loaded in 0.046 seconds)

Similiar Articles:













7/24/2012 3:07:55 AM


Reply: