<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic REST API : how download document in PDF in Nuxeo Forum</title>
    <link>https://connect.hyland.com/t5/nuxeo-forum/rest-api-how-download-document-in-pdf/m-p/321897#M8898</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I use the "rest api" in PHP for listing documents and download them. These documents can be in differents formats (doc, pptx, doc, ...), but I want download only in PDF, like button PDF in Document management.&lt;/P&gt;
&lt;P&gt;How can I do that ?&lt;/P&gt;
&lt;P&gt;Thanks in advance for your answer.&lt;/P&gt;</description>
    <pubDate>Wed, 17 Dec 2014 17:29:19 GMT</pubDate>
    <dc:creator>delphine_</dc:creator>
    <dc:date>2014-12-17T17:29:19Z</dc:date>
    <item>
      <title>REST API : how download document in PDF</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/rest-api-how-download-document-in-pdf/m-p/321897#M8898</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I use the "rest api" in PHP for listing documents and download them. These documents can be in differents formats (doc, pptx, doc, ...), but I want download only in PDF, like button PDF in Document management.&lt;/P&gt;
&lt;P&gt;How can I do that ?&lt;/P&gt;
&lt;P&gt;Thanks in advance for your answer.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Dec 2014 17:29:19 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/rest-api-how-download-document-in-pdf/m-p/321897#M8898</guid>
      <dc:creator>delphine_</dc:creator>
      <dc:date>2014-12-17T17:29:19Z</dc:date>
    </item>
    <item>
      <title>Re: REST API : how download document in PDF</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/rest-api-how-download-document-in-pdf/m-p/321898#M8899</link>
      <description>&lt;P&gt;Solution trouvée !&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;    $client = new NuxeoPhpAutomationClient('[...]/nuxeo/site/automation');

    $session = $client-&amp;gt;getSession($this-&amp;gt;user, $this-&amp;gt;pass); $answer = $session-&amp;gt;newRequest("Blob.ToPDF")
            -&amp;gt;set('input', 'doc:' . $file)
            -&amp;gt;sendRequest();

    if (!isset($answer) OR $answer == false)
        echo '$answer is not set';
    else {
        header('Content-Description: File Transfer');
        header('Content-Type: application/pdf');
        $file = 'fichier.pdf';
        header('Content-Disposition: attachment; filename=' . $file);
        readfile('tempstream');
    }
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Si ça peut aider ...&lt;/P&gt;</description>
      <pubDate>Mon, 22 Dec 2014 10:24:17 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/rest-api-how-download-document-in-pdf/m-p/321898#M8899</guid>
      <dc:creator>delphine_</dc:creator>
      <dc:date>2014-12-22T10:24:17Z</dc:date>
    </item>
  </channel>
</rss>

