R0bb0b Posted October 17, 2008 Share Posted October 17, 2008 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 More sharing options...
Caesar Posted October 17, 2008 Share Posted October 17, 2008 Can you please paste the line it is referencing in the error? As far as the HTML equivalent...it is: < Link to comment https://forums.phpfreaks.com/topic/128914-solved-pdflib-str_replace/#findComment-668361 Share on other sites More sharing options...
R0bb0b Posted October 17, 2008 Author Share Posted October 17, 2008 <?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 "<". Link to comment https://forums.phpfreaks.com/topic/128914-solved-pdflib-str_replace/#findComment-668365 Share on other sites More sharing options...
R0bb0b Posted October 17, 2008 Author Share Posted October 17, 2008 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']); ?> Link to comment https://forums.phpfreaks.com/topic/128914-solved-pdflib-str_replace/#findComment-668372 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.