Get Text in specific location of PDF FILE
<p>I am working on how to merge <code>pdf_file1</code> to <code>pdf_file2</code>. I need to merge <code>pdf_file1</code> to specific pages in file 2. to be able to do that I need to find specific keyword in header of <code>pdf_file2</code></p>

<p>EX: If (keyword == header_of_pdf_file2) then
    <strong>Merge file</strong></p>

<p>here is my current code to merge the 2 pdf</p>

<pre><code>&lt;?php
require_once('fpdf.php');
require_once('fpdi.php');

$pdf = new FPDI();

$pdf-&gt;setSourceFile("pdf_file1");
$tplIdxA = $pdf-&gt;importPage(1, '/MediaBox');

$pagecnt=$pdf-&gt;setSourceFile("pdf_file2.pdf");
$x=1;
  for($i=0; $i&lt;$pagecnt; $i++){
$tplIdxB = $pdf-&gt;importPage(intval($i+1), '/MediaBox');
$pdf-&gt;addPage();
// place the imported page of the first document:
if($i==0){
$pdf-&gt;useTemplate($tplIdxA, 0, 0, 210,300);
// place the imported page of the snd document:
}
$pdf-&gt;useTemplate($tplIdxB, 0, 0, 200,295);
    $x=($i+1)*20;
 }

$pdf-&gt;Output();
</code></pre>