Phantomjs: PDF meta data for title, author, keywords not set with page.render()

Created on 25 Nov 2012  路  5Comments  路  Source: ariya/phantomjs

_[email protected] commented:_

1.7.0 (win32)

Code:
var page = new WebPage();
var system = require("system");
page.open("http://www.spiegel.de", function (status) {
page.render("test.pdf");
phantom.exit();
});

Result: open test.pdf in Foxit Reader: PDF meta data for Title, Subject, Author, Creator, Keywords are empty. Producer gets correctly filled.

The page has:
<title>SPIEGEL ONLINE - Nachrichten</title>
<meta name="author" content="SPIEGEL ONLINE, Hamburg, Germany" />
<meta name="keywords" content="SPIEGEL ONLINE, DER SPIEGEL, Nachrichten, News,Home" />
<meta name="copyright" content="SPIEGEL ONLINE, Hamburg, Germany" />
<meta name="description" content="Deutschlands f眉hrende Nachrichtenseite. Alles Wichtige aus Politik, Wirtschaft, Sport, ...

Had used html2ps before, but phantomjs is much greater for PDF export!

Disclaimer:
This issue was migrated on 2013-03-15 from the project's former issue tracker on Google Code, Issue #883.
:star2:   4 people had starred this issue at the time of migration.

All 5 comments

+1

Any news on implementing this, or any other way to set the metadata?

I use pdftk like this:
/usr/bin/pdftk [infile] update_info_utf8 [meta_data] output [outfile] encrypt_128bit dont_ask owner_pw [pass] allow Printing DegradedPrinting ModifyAnnotations

thx crypto for the tip :)

The scope of PhantomJS should not include a more sophisticated PDF generation. In all cases (and following the Unix principle), such a tweak can be done as a post-processing step (e.g. using pdftk as mentioned earlier).

Was this page helpful?
0 / 5 - 0 ratings

Related issues

maboiteaspam picture maboiteaspam  路  3Comments

machadolab picture machadolab  路  5Comments

yairza picture yairza  路  6Comments

mz3 picture mz3  路  5Comments

gustavohenke picture gustavohenke  路  4Comments