def setMetadata(doc, m):
if doc.isClosed or doc.isEncrypted:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>if type(m) is not dict:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>for k in m.keys():<EOL><INDENT>if not k in ("<STR_LIT>", "<STR_LIT>", "<STR_LIT>", "<STR_LIT:title>", "<STR_LIT>",<EOL>"<STR_LIT>", "<STR_LIT>", "<STR_LIT>", "<STR_LIT>",<EOL>"<STR_LIT>"):<EOL><INDENT>raise ValueError("<STR_LIT>" + k)<EOL><DEDENT><DEDENT>d = "<STR_LIT>"<EOL>d += getPDFstr(m.get("<STR_LIT>", "<STR_LIT:none>"))<EOL>d += "<STR_LIT>"<EOL>d += getPDFstr(m.get("<STR_LIT>", "<STR_LIT:none>"))<EOL>d += "<STR_LIT>"<EOL>d += getPDFstr(m.get("<STR_LIT>", "<STR_LIT:none>"))<EOL>d += "<STR_LIT>"<EOL>d += getPDFstr(m.get("<STR_LIT>", "<STR_LIT:none>"))<EOL>d += "<STR_LIT>"<EOL>d += getPDFstr(m.get("<STR_LIT>", "<STR_LIT:none>"))<EOL>d += "<STR_LIT>"<EOL>d += getPDFstr(m.get("<STR_LIT>", "<STR_LIT:none>"))<EOL>d += "<STR_LIT>"<EOL>d += getPDFstr(m.get("<STR_LIT>", "<STR_LIT:none>"))<EOL>d += "<STR_LIT>"<EOL>d += getPDFstr(m.get("<STR_LIT:title>", "<STR_LIT:none>"))<EOL>d += "<STR_LIT>"<EOL>doc._setMetadata(d)<EOL>doc.initData()<EOL>return<EOL>
Set a PDF's metadata (/Info dictionary)\nm: dictionary like doc.metadata'.