if (preg_match_all("/" . $preg_begin . "/Us", $inhalt, $match)) { if (preg_match_all("/\\[\\/" . $match[1][0] . ".*\\]/Us", $inhalt, $match_end)) { $endtag = -1; } $item = $match[1][0] . $count_tag; ${$item} = $pdf->begin_item($match[1][0], ""); $inhalt = preg_replace("/\\[[\\/A-Za-z0-9=]*\\]/", "", $inhalt); #$inhalt = preg_replace("/\[.*\]/","",$inhalt); $textflow = $pdf->create_textflow($inhalt, "fontname=" . $fontname . " fontsize=10 textformat=utf8 encoding=unicode "); if ($stand == "") { $pdf->fit_textflow($textflow, 50, 120, 550, 820, ""); } else { $pdf->fit_textflow($textflow, 50, 120, 550, $stand, ""); } $stand = $pdf->info_textflow($textflow, "textendy") - 20; } if ($endtag == -1) { $pdf->end_item(${$match}[1][0] . $count_tag); } } $pdf->end_item($doc); $pdf->end_page_ext(""); $pdf->end_document(""); $buf = $pdf->get_buffer(); $len = strlen($buf); header("Content-type: application/pdf"); header("Content-Length: {$len}"); header("Content-Disposition: inline; filename=hello.pdf"); echo $buf; } ////////////////////////////////////////////////////////////////////////////////////////////////////////////////