|
|
|
@@ -199,7 +199,16 @@ which will be converted to PDF.</p>
|
|
|
|
<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-link"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>
|
|
|
|
<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-link"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>
|
|
|
|
</a>PHP</h3>
|
|
|
|
</a>PHP</h3>
|
|
|
|
|
|
|
|
|
|
|
|
<p>TODO</p>
|
|
|
|
<pre class="chroma"><span class="x">use TheCodingMachine\Gotenberg\Client;
|
|
|
|
|
|
|
|
</span><span class="x">use TheCodingMachine\Gotenberg\DocumentFactory;
|
|
|
|
|
|
|
|
</span><span class="x">use TheCodingMachine\Gotenberg\HTMLRequest;
|
|
|
|
|
|
|
|
</span><span class="x">
|
|
|
|
|
|
|
|
</span><span class="x">$client = new Client('http://localhost:3000', new \Http\Adapter\Guzzle6\Client());
|
|
|
|
|
|
|
|
</span><span class="x">$index = DocumentFactory::makeFromPath('index.html', 'index.html');
|
|
|
|
|
|
|
|
</span><span class="x">$request = new HTMLRequest($index);
|
|
|
|
|
|
|
|
</span><span class="x">$dirPath = "/foo";
|
|
|
|
|
|
|
|
</span><span class="x">$filename = $client->store($request, $dirPath);
|
|
|
|
|
|
|
|
</span><span class="x"></span></pre>
|
|
|
|
|
|
|
|
|
|
|
|
<h2 class="Heading"><a class="Anchor" aria-hidden="true" id="html.header_and_footer" href="#html.header_and_footer">
|
|
|
|
<h2 class="Heading"><a class="Anchor" aria-hidden="true" id="html.header_and_footer" href="#html.header_and_footer">
|
|
|
|
<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-link"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>
|
|
|
|
<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-link"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>
|
|
|
|
@@ -278,7 +287,20 @@ Also, <code>footer.html</code> CSS properties override the ones from <code>heade
|
|
|
|
<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-link"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>
|
|
|
|
<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-link"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>
|
|
|
|
</a>PHP</h3>
|
|
|
|
</a>PHP</h3>
|
|
|
|
|
|
|
|
|
|
|
|
<p>TODO</p>
|
|
|
|
<pre class="chroma"><span class="x">use TheCodingMachine\Gotenberg\Client;
|
|
|
|
|
|
|
|
</span><span class="x">use TheCodingMachine\Gotenberg\DocumentFactory;
|
|
|
|
|
|
|
|
</span><span class="x">use TheCodingMachine\Gotenberg\HTMLRequest;
|
|
|
|
|
|
|
|
</span><span class="x">
|
|
|
|
|
|
|
|
</span><span class="x">$client = new Client('http://localhost:3000', new \Http\Adapter\Guzzle6\Client());
|
|
|
|
|
|
|
|
</span><span class="x">$index = DocumentFactory::makeFromPath('index.html', 'index.html');
|
|
|
|
|
|
|
|
</span><span class="x">$header = DocumentFactory::makeFromPath('header.html', 'header.html');
|
|
|
|
|
|
|
|
</span><span class="x">$footer = DocumentFactory::makeFromPath('footer.html', 'footer.html');
|
|
|
|
|
|
|
|
</span><span class="x">$request = new HTMLRequest($index);
|
|
|
|
|
|
|
|
</span><span class="x">$request->setHeader($header);
|
|
|
|
|
|
|
|
</span><span class="x">$request->setFooter($footer);
|
|
|
|
|
|
|
|
</span><span class="x">$dirPath = "/foo";
|
|
|
|
|
|
|
|
</span><span class="x">$filename = $client->store($request, $dirPath);
|
|
|
|
|
|
|
|
</span><span class="x"></span></pre>
|
|
|
|
|
|
|
|
|
|
|
|
<h2 class="Heading"><a class="Anchor" aria-hidden="true" id="html.assets" href="#html.assets">
|
|
|
|
<h2 class="Heading"><a class="Anchor" aria-hidden="true" id="html.assets" href="#html.assets">
|
|
|
|
<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-link"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>
|
|
|
|
<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-link"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>
|
|
|
|
@@ -365,7 +387,22 @@ see to the <a href="#office.fonts">fonts section</a>.</p>
|
|
|
|
<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-link"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>
|
|
|
|
<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-link"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>
|
|
|
|
</a>PHP</h3>
|
|
|
|
</a>PHP</h3>
|
|
|
|
|
|
|
|
|
|
|
|
<p>TODO</p>
|
|
|
|
<pre class="chroma"><span class="x">use TheCodingMachine\Gotenberg\Client;
|
|
|
|
|
|
|
|
</span><span class="x">use TheCodingMachine\Gotenberg\DocumentFactory;
|
|
|
|
|
|
|
|
</span><span class="x">use TheCodingMachine\Gotenberg\HTMLRequest;
|
|
|
|
|
|
|
|
</span><span class="x">
|
|
|
|
|
|
|
|
</span><span class="x">$client = new Client('http://localhost:3000', new \Http\Adapter\Guzzle6\Client());
|
|
|
|
|
|
|
|
</span><span class="x">$index = DocumentFactory::makeFromPath('index.html', 'index.html');
|
|
|
|
|
|
|
|
</span><span class="x">$assets = [
|
|
|
|
|
|
|
|
</span><span class="x"> DocumentFactory::makeFromPath('style.css', 'style.css'),
|
|
|
|
|
|
|
|
</span><span class="x"> DocumentFactory::makeFromPath('img.png', 'img.png'),
|
|
|
|
|
|
|
|
</span><span class="x"> DocumentFactory::makeFromPath('font.woff', 'font.woff'),
|
|
|
|
|
|
|
|
</span><span class="x">];
|
|
|
|
|
|
|
|
</span><span class="x">$request = new HTMLRequest($index);
|
|
|
|
|
|
|
|
</span><span class="x">$request->setAssets($assets);
|
|
|
|
|
|
|
|
</span><span class="x">$dirPath = "/foo";
|
|
|
|
|
|
|
|
</span><span class="x">$filename = $client->store($request, $dirPath);
|
|
|
|
|
|
|
|
</span><span class="x"></span></pre>
|
|
|
|
|
|
|
|
|
|
|
|
<h2 class="Heading"><a class="Anchor" aria-hidden="true" id="html.paper_size_margins_orientation" href="#html.paper_size_margins_orientation">
|
|
|
|
<h2 class="Heading"><a class="Anchor" aria-hidden="true" id="html.paper_size_margins_orientation" href="#html.paper_size_margins_orientation">
|
|
|
|
<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-link"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>
|
|
|
|
<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-link"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>
|
|
|
|
@@ -423,7 +460,20 @@ Also, you have to set both <code>paperWidth</code> and <code>paperHeight</code>.
|
|
|
|
<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-link"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>
|
|
|
|
<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-link"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>
|
|
|
|
</a>PHP</h3>
|
|
|
|
</a>PHP</h3>
|
|
|
|
|
|
|
|
|
|
|
|
<p>TODO</p>
|
|
|
|
<pre class="chroma"><span class="x">use TheCodingMachine\Gotenberg\Client;
|
|
|
|
|
|
|
|
</span><span class="x">use TheCodingMachine\Gotenberg\DocumentFactory;
|
|
|
|
|
|
|
|
</span><span class="x">use TheCodingMachine\Gotenberg\HTMLRequest;
|
|
|
|
|
|
|
|
</span><span class="x">use TheCodingMachine\Gotenberg\Request;
|
|
|
|
|
|
|
|
</span><span class="x">
|
|
|
|
|
|
|
|
</span><span class="x">$client = new Client('http://localhost:3000', new \Http\Adapter\Guzzle6\Client());
|
|
|
|
|
|
|
|
</span><span class="x">$index = DocumentFactory::makeFromPath('index.html', 'index.html');
|
|
|
|
|
|
|
|
</span><span class="x">$request = new HTMLRequest($index);
|
|
|
|
|
|
|
|
</span><span class="x">$request->setPaperSize(Request::A4);
|
|
|
|
|
|
|
|
</span><span class="x">$request->setMargins(Request::NO_MARGINS);
|
|
|
|
|
|
|
|
</span><span class="x">$request->setLandscape(true);
|
|
|
|
|
|
|
|
</span><span class="x">$dirPath = "/foo";
|
|
|
|
|
|
|
|
</span><span class="x">$filename = $client->store($request, $dirPath);
|
|
|
|
|
|
|
|
</span><span class="x"></span></pre>
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
@@ -493,7 +543,19 @@ in the file <code>index.html</code> which will convert a given markdown file to
|
|
|
|
<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-link"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>
|
|
|
|
<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-link"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>
|
|
|
|
</a>PHP</h3>
|
|
|
|
</a>PHP</h3>
|
|
|
|
|
|
|
|
|
|
|
|
<p>TODO</p>
|
|
|
|
<pre class="chroma"><span class="x">use TheCodingMachine\Gotenberg\Client;
|
|
|
|
|
|
|
|
</span><span class="x">use TheCodingMachine\Gotenberg\DocumentFactory;
|
|
|
|
|
|
|
|
</span><span class="x">use TheCodingMachine\Gotenberg\MarkdownRequest;
|
|
|
|
|
|
|
|
</span><span class="x">
|
|
|
|
|
|
|
|
</span><span class="x">$client = new Client('http://localhost:3000', new \Http\Adapter\Guzzle6\Client());
|
|
|
|
|
|
|
|
</span><span class="x">$index = DocumentFactory::makeFromPath('index.html', 'index.html');
|
|
|
|
|
|
|
|
</span><span class="x">$markdowns = [
|
|
|
|
|
|
|
|
</span><span class="x"> DocumentFactory::makeFromPath('file.md', 'file.md'),
|
|
|
|
|
|
|
|
</span><span class="x">];
|
|
|
|
|
|
|
|
</span><span class="x">$request = new MarkdownRequest($index, $markdowns);
|
|
|
|
|
|
|
|
</span><span class="x">$dirPath = "/foo";
|
|
|
|
|
|
|
|
</span><span class="x">$filename = $client->store($request, $dirPath);
|
|
|
|
|
|
|
|
</span><span class="x"></span></pre>
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
@@ -566,7 +628,19 @@ See the <a href="#scalability">scalability section</a> to find how to mitigate t
|
|
|
|
<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-link"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>
|
|
|
|
<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-link"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>
|
|
|
|
</a>PHP</h3>
|
|
|
|
</a>PHP</h3>
|
|
|
|
|
|
|
|
|
|
|
|
<p>TODO</p>
|
|
|
|
<pre class="chroma"><span class="x">use TheCodingMachine\Gotenberg\Client;
|
|
|
|
|
|
|
|
</span><span class="x">use TheCodingMachine\Gotenberg\DocumentFactory;
|
|
|
|
|
|
|
|
</span><span class="x">use TheCodingMachine\Gotenberg\OfficeRequest;
|
|
|
|
|
|
|
|
</span><span class="x">
|
|
|
|
|
|
|
|
</span><span class="x">$client = new Client('http://localhost:3000', new \Http\Adapter\Guzzle6\Client());
|
|
|
|
|
|
|
|
</span><span class="x">$files = [
|
|
|
|
|
|
|
|
</span><span class="x"> DocumentFactory::makeFromPath('document.docx', 'document.docx'),
|
|
|
|
|
|
|
|
</span><span class="x"> DocumentFactory::makeFromPath('document2.docx', 'document2.docx'),
|
|
|
|
|
|
|
|
</span><span class="x">];
|
|
|
|
|
|
|
|
</span><span class="x">$request = new OfficeRequest($files);
|
|
|
|
|
|
|
|
</span><span class="x">$dirPath = "/foo";
|
|
|
|
|
|
|
|
</span><span class="x">$filename = $client->store($request, $dirPath);
|
|
|
|
|
|
|
|
</span><span class="x"></span></pre>
|
|
|
|
|
|
|
|
|
|
|
|
<h2 class="Heading"><a class="Anchor" aria-hidden="true" id="office.fonts" href="#office.fonts">
|
|
|
|
<h2 class="Heading"><a class="Anchor" aria-hidden="true" id="office.fonts" href="#office.fonts">
|
|
|
|
<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-link"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>
|
|
|
|
<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-link"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>
|
|
|
|
@@ -633,7 +707,19 @@ will merge them and return the resulting PDF file.</p>
|
|
|
|
<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-link"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>
|
|
|
|
<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-link"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>
|
|
|
|
</a>PHP</h3>
|
|
|
|
</a>PHP</h3>
|
|
|
|
|
|
|
|
|
|
|
|
<p>TODO</p>
|
|
|
|
<pre class="chroma"><span class="x">use TheCodingMachine\Gotenberg\Client;
|
|
|
|
|
|
|
|
</span><span class="x">use TheCodingMachine\Gotenberg\DocumentFactory;
|
|
|
|
|
|
|
|
</span><span class="x">use TheCodingMachine\Gotenberg\MergeRequest;
|
|
|
|
|
|
|
|
</span><span class="x">
|
|
|
|
|
|
|
|
</span><span class="x">$client = new Client('http://localhost:3000', new \Http\Adapter\Guzzle6\Client());
|
|
|
|
|
|
|
|
</span><span class="x">$files = [
|
|
|
|
|
|
|
|
</span><span class="x"> DocumentFactory::makeFromPath('file.pdf', 'file.pdf'),
|
|
|
|
|
|
|
|
</span><span class="x"> DocumentFactory::makeFromPath('file2.pdf', 'file2.pdf'),
|
|
|
|
|
|
|
|
</span><span class="x">];
|
|
|
|
|
|
|
|
</span><span class="x">$request = new MergeRequest($files);
|
|
|
|
|
|
|
|
</span><span class="x">$dirPath = "/foo";
|
|
|
|
|
|
|
|
</span><span class="x">$filename = $client->store($request, $dirPath);
|
|
|
|
|
|
|
|
</span><span class="x"></span></pre>
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
@@ -687,7 +773,16 @@ to given URL.</p>
|
|
|
|
<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-link"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>
|
|
|
|
<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-link"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg>
|
|
|
|
</a>PHP</h3>
|
|
|
|
</a>PHP</h3>
|
|
|
|
|
|
|
|
|
|
|
|
<p>TODO</p>
|
|
|
|
<pre class="chroma"><span class="x">use TheCodingMachine\Gotenberg\Client;
|
|
|
|
|
|
|
|
</span><span class="x">use TheCodingMachine\Gotenberg\DocumentFactory;
|
|
|
|
|
|
|
|
</span><span class="x">use TheCodingMachine\Gotenberg\HTMLRequest;
|
|
|
|
|
|
|
|
</span><span class="x">
|
|
|
|
|
|
|
|
</span><span class="x">$client = new Client('http://localhost:3000', new \Http\Adapter\Guzzle6\Client());
|
|
|
|
|
|
|
|
</span><span class="x">$index = DocumentFactory::makeFromPath('index.html', 'index.html');
|
|
|
|
|
|
|
|
</span><span class="x">$request = new HTMLRequest($index);
|
|
|
|
|
|
|
|
</span><span class="x">$request->setWebhookURL('http://myapp.com/webhook/');
|
|
|
|
|
|
|
|
</span><span class="x">$resp = $client->post($request);
|
|
|
|
|
|
|
|
</span><span class="x"></span></pre>
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|