{"action":"created","issue":{"url":"https://api.github.com/repos/dompdf/dompdf/issues/1265","repository_url":"https://api.github.com/repos/dompdf/dompdf","labels_url":"https://api.github.com/repos/dompdf/dompdf/issues/1265/labels{/name}","comments_url":"https://api.github.com/repos/dompdf/dompdf/issues/1265/comments","events_url":"https://api.github.com/repos/dompdf/dompdf/issues/1265/events","html_url":"https://github.com/dompdf/dompdf/issues/1265","id":175729736,"number":1265,"title":"Example of Embedded PHP support","user":{"login":"antoniogarcia78","id":1194110,"avatar_url":"https://avatars.githubusercontent.com/u/1194110?v=3","gravatar_id":"","url":"https://api.github.com/users/antoniogarcia78","html_url":"https://github.com/antoniogarcia78","followers_url":"https://api.github.com/users/antoniogarcia78/followers","following_url":"https://api.github.com/users/antoniogarcia78/following{/other_user}","gists_url":"https://api.github.com/users/antoniogarcia78/gists{/gist_id}","starred_url":"https://api.github.com/users/antoniogarcia78/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/antoniogarcia78/subscriptions","organizations_url":"https://api.github.com/users/antoniogarcia78/orgs","repos_url":"https://api.github.com/users/antoniogarcia78/repos","events_url":"https://api.github.com/users/antoniogarcia78/events{/privacy}","received_events_url":"https://api.github.com/users/antoniogarcia78/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/dompdf/dompdf/labels/documentation","name":"documentation","color":"bfdadc"},{"url":"https://api.github.com/repos/dompdf/dompdf/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-09-08T11:28:20Z","updated_at":"2016-09-08T21:38:08Z","closed_at":null,"body":"I use this script inside the html load in the dompdf object\r\n```\r\n<script type=\"text/php\">\r\n$pdf->text(100, 100, \"Pagina {$PAGE_NUM} de {$PAGE_COUNT}\", $fontMetrics->getFont(\"Arial\"), 10, array(0, 0, 0));\r\n</script>\r\n```\r\n\r\nThe php is\r\n\r\n```\r\n$dompdf->loadHtml($html);\r\n$dompdf->setPaper('A4', 'landscape');\r\n$dompdf->render();\r\n$options = new \\Dompdf\\Options();\r\n$options->setIsPhpEnabled(true);\r\n$dompdf->setOptions($options);\r\n$canvas = $dompdf->getCanvas();\r\n$dompdf->stream();\r\n```\r\n\r\nI see nothing.\r\nAny way to debug this? Thankyou"},"comment":{"url":"https://api.github.com/repos/dompdf/dompdf/issues/comments/245749757","html_url":"https://github.com/dompdf/dompdf/issues/1265#issuecomment-245749757","issue_url":"https://api.github.com/repos/dompdf/dompdf/issues/1265","id":245749757,"user":{"login":"bsweeney","id":485897,"avatar_url":"https://avatars.githubusercontent.com/u/485897?v=3","gravatar_id":"","url":"https://api.github.com/users/bsweeney","html_url":"https://github.com/bsweeney","followers_url":"https://api.github.com/users/bsweeney/followers","following_url":"https://api.github.com/users/bsweeney/following{/other_user}","gists_url":"https://api.github.com/users/bsweeney/gists{/gist_id}","starred_url":"https://api.github.com/users/bsweeney/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bsweeney/subscriptions","organizations_url":"https://api.github.com/users/bsweeney/orgs","repos_url":"https://api.github.com/users/bsweeney/repos","events_url":"https://api.github.com/users/bsweeney/events{/privacy}","received_events_url":"https://api.github.com/users/bsweeney/received_events","type":"User","site_admin":false},"created_at":"2016-09-08T21:38:07Z","updated_at":"2016-09-08T21:38:07Z","body":"Try something more like this for your PHP:\r\n\r\n```\r\n$options = new \\Dompdf\\Options();\r\n$options->setIsPhpEnabled(true);\r\n$dompdf = new Dompdf($options);\r\n$dompdf->loadHtml($html);\r\n$dompdf->setPaper('A4', 'landscape');\r\n$dompdf->render();\r\n$dompdf->stream();\r\n```\r\n\r\nDompdf determines what to do with the embedded script when you render the document, so you'll want to set that option before you render."}}
{"actor":{"display_login":"bsweeney"}}