Page 1 of 1

PDFlib question

Posted: Tue Mar 02, 2004 7:32 am
by hyper_st8
Is it possible to find the position of a text word and then when you output the new pdf file, using pdf_show_xy to replace the text. Tried a tutorial that does a replacement on the text, using:

function pdf_replace($pattern, $replacement, $string)
{
$len = strlen($pattern);
$regexp = '';
for ($i = 0; $i<$len; $i++)
{
$regexp .= $pattern[$i];
if ($i<$len-1)
$regexp .= "(\)\-{0,1}[0-9]*\(){0,1}";
}
return ereg_replace ($regexp, $replacement, $string);
}

but doesn't seem to work with any Adobe (5) made files, causing the CPU to go to 100% and an I/O error.

Thanks in advance.