开发者

Set PDF metadata via Ruby or Command line tool

Within my ruby program, I'd like to open an existing PDF file, set the title and author metadata, and save the file.

I've look through the documentation of Prawn and other PDF libraries, but no luck. If there isn't a ruby way to do开发者_C百科 it, a command line utility (pdftk?) is OK, but preferably available as a Mac and Linux binary.

Thanks for your time.


Prawn is the premier PDF library for ruby, but it seems to be a writer only, not a reader.

The simplest command line tool for Linux/Mac to install and use, by far, seems to be exiftools, and this is what I'm using in my scripts.

An example command is: exiftools -Title="My Title" -Subject="My Subject" -overwrite_original

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜