<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hi John,<br>
<br>
I think that the point the metadata would get lost is when the
covering pdf file is stitched to the original pdf, generating a
covered version. In the latest coversheet bazaar package uses
ghostscript(gs) as the stitching program, which is not preserving
the metadata.<br>
<br>
Pdftk
(<a class="moz-txt-link-freetext" href="https://www.pdflabs.com/docs/install-pdftk-on-redhat-or-centos/">https://www.pdflabs.com/docs/install-pdftk-on-redhat-or-centos/</a>),
which is a more comprehensive program that may have option to
preserve the metadata, was used previously until a serious bug
caused it to loop/never finish processing the stitching process for
some types of pdf files. The bug was believed to be fixed in a more
recent version of pdftk, but it has not been fully tested in eprints
yet. <br>
<br>
It is probably worth to try to install the latest version of pdftk
and ask eprints to use it as the stitching program.<br>
<br>
<br>
<u>To switch to use pdftk</u><u> in eprints</u><br>
/opt/eprints3/lib/plugins/EPrints/Plugin/Convert/AddCoversheet.pm
line @ 215<br>
<blockquote type="cite"><small><small> my $temp_output_dir =
File::Temp->newdir( "ep-coversheet-finishedXXXX", TMPDIR
=> 1 );<br>
my $temp_output_file = $temp_dir.'/temp.pdf';<br>
<br>
<br>
##switch back using pdftk <br>
my $pdftk = $plugin->get_repository->get_conf(
"executables", "pdftk" );<br>
system( $pdftk, @input_files, "cat", "output",
$temp_output_file );<br>
<br>
copy($temp_output_file, $output_file);<br>
<br>
# check it worked<br>
unless( -e $output_file && -s $output_file )
#check files exists and is not zero length<br>
{<br>
$repository->log("[Convert::AddCoversheet]
pdftk could not create '$output_file'. Check the PDF is not
password-protected.");<br>
return;<br>
}<br>
<br>
<br>
##>>>>>>>>>>>>>>><br>
=begin GHOST<br>
# EPrints Services/pjw Modification to use Ghostscript
rather than pdftk <br>
my $gs_cmd = $plugin->get_repository->get_conf(
"gs_pdf_stich_cmd" );<br>
# add the output file<br>
$gs_cmd .= $temp_output_file;<br>
# add the input files<br>
foreach my $input_file (@input_files)<br>
{<br>
$gs_cmd .= " '$input_file'";<br>
}<br>
<br>
my $sys_call_status = system($gs_cmd);<br>
# check it worked<br>
if (0 == $sys_call_status)<br>
{<br>
copy($temp_output_file, $output_file);<br>
}<br>
else<br>
{<br>
my $eprint = $doc->get_eprint;<br>
# $repository->mail_administrator(
'Plugin/Screen/Coversheet:email_subject', <br>
#
'Plugin/Screen/Coversheet:email_body', <br>
# eprintid
=> $eprint->render_value("eprintid"),<br>
# docid =>
$doc->render_value("docid") );<br>
<br>
$repository->log("[Convert::AddCoversheet]
Ghostscript could not create '$output_file'. Check the PDF is
not password-protected.");<br>
return;<br>
}<br>
=end GHOST<br>
=cut<br>
##<<<<<<<<<<<<<<<<<<<<<br>
<br>
<br>
EPrints::Utils::chown_for_eprints( $output_file );</small></small><br>
</blockquote>
<br>
in archive/[repoid]/cfg/cfg.d/z_coversheet.pl @line 30<br>
<blockquote type="cite"><small>##Add pdftk executable path:<br>
$c->{executables}->{pdftk} = "/usr/bin/pdftk";</small><u><br>
</u></blockquote>
<br>
<br>
<br>
Best<br>
Jiadi<br>
<br>
<br>
<div class="moz-cite-prefix">On 23/09/2014 12:25, John Salter wrote:<br>
</div>
<blockquote
cite="mid:EMEW3|6b580a28d2e806b308d05595a8ac0f20q8MCQJ14eprints-tech-bounces|ecs.soton.ac.uk|7154BCBB8909D642AE6F44CA713DBC2009A4D2417EAD@HERMES7.ds.leeds.ac.uk"
type="cite">
<pre wrap="">Hi,
Does anyone around here have anything to do with the 'Coverpages' bazaar package?
<a class="moz-txt-link-freetext" href="http://bazaar.eprints.org/cgi/search/simple?q=Coversheets">http://bazaar.eprints.org/cgi/search/simple?q=Coversheets</a>
In particular I'm looking at the metadata associated with the resulting (covered) PDF. On the UKCoRR mailing list, there was a claim that some work had been done so that metadata that existed in the original PDF wasn't affected?
Cheers,
John
*** Options: <a class="moz-txt-link-freetext" href="http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech">http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech</a>
*** Archive: <a class="moz-txt-link-freetext" href="http://www.eprints.org/tech.php/">http://www.eprints.org/tech.php/</a>
*** EPrints community wiki: <a class="moz-txt-link-freetext" href="http://wiki.eprints.org/">http://wiki.eprints.org/</a>
*** EPrints developers Forum: <a class="moz-txt-link-freetext" href="http://forum.eprints.org/">http://forum.eprints.org/</a>
</pre>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
Jiadi Yao
<a class="moz-txt-link-abbreviated" href="mailto:jy2e08@ecs.soton.ac.uk">jy2e08@ecs.soton.ac.uk</a>
EPrints Services
3081, Building 32
University of Southampton</pre>
</body>
</html>