<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hi John, <br>
    <br>
    Sorry, I do not have any sample pdfs for you to test on. <br>
    <br>
    I think it was failing on some Mac generated pdfs that do not
    conform the pdf standard.  <br>
    <br>
    regards,<br>
    Jiadi<br>
    <br>
    <br>
    <div class="moz-cite-prefix">On 23/09/2014 16:39, John Salter wrote:<br>
    </div>
    <blockquote
cite="mid:EMEW3|dde7ebec8747800452cc6fe2cb0ebff0q8MGeM14eprints-tech-bounces|ecs.soton.ac.uk|7154BCBB8909D642AE6F44CA713DBC2009A4D2417EB8@HERMES7.ds.leeds.ac.uk"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html;
        charset=windows-1252">
      <meta name="Generator" content="Microsoft Word 14 (filtered
        medium)">
      <style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";
        color:black;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";
        color:black;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;
        color:black;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
      <div class="WordSection1">
        <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">Hi
            Jiadi,<o:p></o:p></span></p>
        <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">Glad
            someone knows about this :o)<o:p></o:p></span></p>
        <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">I’ll
            take a look at this and see how I get on – were any sample
            PDFs that failed/looped saved so I can test them too (no
            problems if not!)?<o:p></o:p></span></p>
        <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">Cheers,<o:p></o:p></span></p>
        <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">John<o:p></o:p></span></p>
        <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p> </o:p></span></p>
        <div>
          <div style="border:none;border-top:solid #B5C4DF
            1.0pt;padding:3.0pt 0cm 0cm 0cm">
            <p class="MsoNormal"><b><span
style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;;color:windowtext"
                  lang="EN-US">From:</span></b><span
style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;;color:windowtext"
                lang="EN-US"> <a class="moz-txt-link-abbreviated" href="mailto:eprints-tech-bounces@ecs.soton.ac.uk">eprints-tech-bounces@ecs.soton.ac.uk</a>
                [<a class="moz-txt-link-freetext" href="mailto:eprints-tech-bounces@ecs.soton.ac.uk">mailto:eprints-tech-bounces@ecs.soton.ac.uk</a>] <b>On
                  Behalf Of </b>Jiadi Yao<br>
                <b>Sent:</b> 23 September 2014 16:10<br>
                <b>To:</b> <a class="moz-txt-link-abbreviated" href="mailto:eprints-tech@ecs.soton.ac.uk">eprints-tech@ecs.soton.ac.uk</a><br>
                <b>Subject:</b> [EP-tech] Re: Coversheets - anyone
                involved with the development still around?<o:p></o:p></span></p>
          </div>
        </div>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">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 moz-do-not-send="true"
            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 in eprints</u><br>
          /opt/eprints3/lib/plugins/EPrints/Plugin/Convert/AddCoversheet.pm
          line @ 215<br>
          <br>
          <o:p></o:p></p>
        <p class="MsoNormal"><span style="font-size:7.5pt">        my
            $temp_output_dir = File::Temp-&gt;newdir(
            "ep-coversheet-finishedXXXX", TMPDIR =&gt; 1 );<br>
                    my $temp_output_file = $temp_dir.'/temp.pdf';<br>
            <br>
            <br>
            ##switch back using pdftk  <br>
                    my $pdftk = $plugin-&gt;get_repository-&gt;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 &amp;&amp; -s $output_file )
            #check files exists and is not zero length<br>
                    {<br>
                           
            $repository-&gt;log("[Convert::AddCoversheet] pdftk could
            not create '$output_file'. Check the PDF is not
            password-protected.");<br>
                            return;<br>
                    }<br>
            <br>
            <br>
##&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;<br>
            =begin GHOST<br>
                    # EPrints Services/pjw Modification to use
            Ghostscript rather than pdftk <br>
                    my $gs_cmd =
            $plugin-&gt;get_repository-&gt;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-&gt;get_eprint;<br>
            #                       $repository-&gt;mail_administrator(
            'Plugin/Screen/Coversheet:email_subject', <br>
            #                                                
            'Plugin/Screen/Coversheet:email_body', <br>
            #                                                 eprintid
            =&gt; $eprint-&gt;render_value("eprintid"),<br>
            #                                                 docid
            =&gt; $doc-&gt;render_value("docid") );<br>
            <br>
                           
            $repository-&gt;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>
##&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;<br>
            <br>
            <br>
                    EPrints::Utils::chown_for_eprints( $output_file );</span><o:p></o:p></p>
        <p class="MsoNormal"><br>
          in archive/[repoid]/cfg/cfg.d/z_coversheet.pl  @line 30<br>
          <br>
          <o:p></o:p></p>
        <p class="MsoNormal"><span style="font-size:10.0pt">##Add pdftk
            executable path:<br>
            $c-&gt;{executables}-&gt;{pdftk} = "/usr/bin/pdftk";</span><o:p></o:p></p>
        <p class="MsoNormal" style="margin-bottom:12.0pt"><br>
          <br>
          <br>
          Best<br>
          Jiadi<br>
          <br>
          <o:p></o:p></p>
        <div>
          <p class="MsoNormal">On 23/09/2014 12:25, John Salter wrote:<o:p></o:p></p>
        </div>
        <blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
          <pre>Hi,<o:p></o:p></pre>
          <pre>Does anyone around here have anything to do with the 'Coverpages' bazaar package?<o:p></o:p></pre>
          <pre><a moz-do-not-send="true" href="http://bazaar.eprints.org/cgi/search/simple?q=Coversheets">http://bazaar.eprints.org/cgi/search/simple?q=Coversheets</a> <o:p></o:p></pre>
          <pre>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?<o:p></o:p></pre>
          <pre><o:p> </o:p></pre>
          <pre>Cheers,<o:p></o:p></pre>
          <pre>John<o:p></o:p></pre>
          <pre><o:p> </o:p></pre>
          <pre>*** Options: <a moz-do-not-send="true" href="http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech">http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech</a><o:p></o:p></pre>
          <pre>*** Archive: <a moz-do-not-send="true" href="http://www.eprints.org/tech.php/">http://www.eprints.org/tech.php/</a><o:p></o:p></pre>
          <pre>*** EPrints community wiki: <a moz-do-not-send="true" href="http://wiki.eprints.org/">http://wiki.eprints.org/</a><o:p></o:p></pre>
          <pre>*** EPrints developers Forum: <a moz-do-not-send="true" href="http://forum.eprints.org/">http://forum.eprints.org/</a><o:p></o:p></pre>
        </blockquote>
        <p class="MsoNormal"><br>
          <br>
          <o:p></o:p></p>
        <pre>-- <o:p></o:p></pre>
        <pre>Jiadi Yao<o:p></o:p></pre>
        <pre><a moz-do-not-send="true" href="mailto:jy2e08@ecs.soton.ac.uk">jy2e08@ecs.soton.ac.uk</a><o:p></o:p></pre>
        <pre>EPrints Services<o:p></o:p></pre>
        <pre>3081, Building 32<o:p></o:p></pre>
        <pre>University of Southampton<o:p></o:p></pre>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">*** 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>