Jump to content

[SOLVED] pdflib str_replace("<", ?


R0bb0b

Recommended Posts

I am using pdflib and am getting this error

"Fatal error: Uncaught exception 'PDFlibException' with message 'Unknown macro '&' in Textflow' in /usr/local/apache2/azfmc/html/cases/printdn.php:478 Stack trace: #0 /usr/local/apache2/azfmc/html/cases/printdn.php(478): pdf_create_textflow(Resource id #5, '/usr/local/apache2/azfmc/html/cases/printdn.php on line 478"

 

What it is doing is finding a "<" in the text and considering that to be the start of a macro.  What can I replace "<" with that will show up as "<" in a pdflib pdf document that won't confuse the parser?  I've already looked through my dingbat chart and don't see it there.

Link to comment
https://forums.phpfreaks.com/topic/128914-solved-pdflib-str_replace/
Share on other sites

<?php
$textflow=PDF_create_textflow($pdf, $macros.$doccontent, "fontname=Times-Roman fontsize=10 encoding=winansi leading=118%");
PDF_fit_textflow($pdf, $textflow, 70, 50, 550, 750, "showborder=false");
PDF_delete_textflow($pdf, $textflow);
?>

I have tried "<" and it just displays as "<" and not "<".

 

I got it, you need to call the function

<?php pdf_set_parameter($pdf, "escapesequence", "true"); ?>

after you instantiate the pdf object and then you can use a whole range of encoded characters. 

After I set the parameter "escapesequence" as "true" I could then use

<?php str_replace("<", "\\074", $noterow['note']); ?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.