Read pdf keywords with php
<p>Anyone know a simple way to "read"/extract keywords from .pdf file?
This file is not password protected and it was generated on the same server usinf FPDF class.</p>

<p>I know there is some "powerful" tool (not free) to manipulate .pdf that provide a simple way to get out all the metadata.</p>

<p>I also know that .pdf store all metadata inside &lt;&lt; >> character, using the special character / before the name of metadata to identify that. 
What I need is the string after the "/Keywords" and store in a variable.</p>

<p>Any idea to parse and get only that string?</p>

<p>(currently I'm writing a JSON string inside keywords, so it's look like this: <code>([{"FirstName":"7bis","LastName":"lastName","email":"email@email.com"}])</code> )</p>

<p>Opening the pdf file with a text editor looks like:</p>

<pre><code>/F1 6 0 R
&gt;&gt;
/XObject &lt;&lt;
&gt;&gt;
&gt;&gt;
endobj
7 0 obj
&lt;&lt;
/Keywords ([{"FirstName":"7bis","LastName":"lastName","email":"email@email.com"}])
/Producer (FPDF 1.81)
/CreationDate (D:20160531084015)
&gt;&gt;
endobj
</code></pre>

<p>Thanks for all suggestion ;)</p>