Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


Can't Update / Add MetaData to PDF that uses Template #417

txt8888 opened this Issue · 5 comments

4 participants


When new a PDF based on a template, none of the :info = { ... } will be applied to the PDF file.

pdf = => "sample.pdf",
:info => {
:Title => "Sample METADATA",
:Author => "Me",
:Subject => "Not Working",
:CreationDate =>,


Currently Prawn is deferring to the template for info and ignoring anything passed in.

It would not be difficult and seems appropriate to at least merge the info option from Document#new.

Can anyone think of a reason why we would not want to do this?


@jonsgreen I think that we should merge in any :info that was explicitly provided to I'm not convinced that we should always override the metadata, for example setting Creator to "Prawn".


Thanks for the comment. Looking forward to the change.

@jonsgreen jonsgreen referenced this issue from a commit in jonsgreen/prawn
@jonsgreen jonsgreen Resolves Issue #417: Can't Update / Add MetaData to PDF that uses Tem…

- merge info metadata when creating with template

@bradediger: I have submitted a pull request for this issue.

I think that if we do not want people to be overriding Prawn as Creator then we should make that a separate issue since we currently are allowing that for all documents when we call #normalize_metadata.


Oh, sorry, I definitely didn't mean to imply that we should prevent people from overriding Prawn as Creator. I was confused and thought the merge would have been happening the other way (merging in the template's information on top of the Prawn document's, which sounds like it is actually the previous behavior).

Your pull request looks good, and I merged it.

@practicingruby practicingruby removed the stale label
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.