使用PHP

时间:2016-12-16 15:45:49

标签: php pdf

情况是我们从另一台服务器获取pdf的内容,并且pdf可以通过以下方式下载。

$file = base64_decode ((string) $document->content);
$filename = (!empty($document->FileName)) ? (string) $document->FileName : 'Document';
drupal_add_http_header('Content-Type', 'application/pdf');
drupal_add_http_header('Content-Disposition', 'attachment; filename=' . $filename);
echo $file;
exit;

现在我想将一些pdf文档的字符串从“xyz”替换为“abc”。我不知道怎么能这样做。如何替换pdf内容中的某些字符串?我试过str_replace,它根本不起作用。

0 个答案:

没有答案