{"action":"created","issue":{"url":"https://api.github.com/repos/kartik-v/yii2-mpdf/issues/24","repository_url":"https://api.github.com/repos/kartik-v/yii2-mpdf","labels_url":"https://api.github.com/repos/kartik-v/yii2-mpdf/issues/24/labels{/name}","comments_url":"https://api.github.com/repos/kartik-v/yii2-mpdf/issues/24/comments","events_url":"https://api.github.com/repos/kartik-v/yii2-mpdf/issues/24/events","html_url":"https://github.com/kartik-v/yii2-mpdf/issues/24","id":111204159,"node_id":"MDU6SXNzdWUxMTEyMDQxNTk=","number":24,"title":"Cannot generate simple PDF ","user":{"login":"alemedinam","id":8710066,"node_id":"MDQ6VXNlcjg3MTAwNjY=","avatar_url":"https://avatars1.githubusercontent.com/u/8710066?v=4","gravatar_id":"","url":"https://api.github.com/users/alemedinam","html_url":"https://github.com/alemedinam","followers_url":"https://api.github.com/users/alemedinam/followers","following_url":"https://api.github.com/users/alemedinam/following{/other_user}","gists_url":"https://api.github.com/users/alemedinam/gists{/gist_id}","starred_url":"https://api.github.com/users/alemedinam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alemedinam/subscriptions","organizations_url":"https://api.github.com/users/alemedinam/orgs","repos_url":"https://api.github.com/users/alemedinam/repos","events_url":"https://api.github.com/users/alemedinam/events{/privacy}","received_events_url":"https://api.github.com/users/alemedinam/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2015-10-13T15:23:57Z","updated_at":"2018-10-08T18:04:22Z","closed_at":null,"author_association":"NONE","body":"Yii 2.0.6\nPHP 5.4.7\nLinux mint 17.2\n\nCONTROLLER:\n\n``` php\npublic function actionReporteProgramaPdf()\n    {\n        // get your HTML raw content without any layouts or scripts\n        $content = $this->renderPartial('reporteProgramaPdf');        \n\n        // setup kartik\\mpdf\\Pdf component\n        $pdf = new Pdf([\n            // set to use core fonts only\n            'mode' => Pdf::MODE_CORE, \n            // LETTER paper format\n            'format' => Pdf::FORMAT_LETTER, \n            // portrait orientation\n            'orientation' => Pdf::ORIENT_PORTRAIT, \n            // stream to browser inline\n            'destination' => Pdf::DEST_BROWSER, \n            // your html content input\n            'content' => $content,  \n            // format content from your own css file if needed or use the\n            // enhanced bootstrap css built by Krajee for mPDF formatting \n            'cssFile' => '@vendor/kartik-v/yii2-mpdf/assets/kv-mpdf-bootstrap.min.css',\n            // any css to be embedded if required\n            'cssInline' => '.kv-heading-1{font-size:18px}', \n             // set mPDF properties on the fly\n            'options' => ['title' => 'Krajee Report Title'],\n             // call mPDF methods on the fly\n            'methods' => [\n                'SetHeader'=>['Krajee Report Header'], \n                'SetFooter'=>['{PAGENO}'],\n            ]\n        ]);\n\n        // return the pdf output as per the destination setting\n        return $pdf->render(); \n    }\n```\n\nVIEW:\n\n``` php\n<?php \necho'INFORMACIÓN';\n?>\n```\n\nRESULT:\n\n%PDF-1.4 %���� 3 0 obj <> /Contents 4 0 R>> endobj 4 0 obj <> stream x��R�N�0\u0018��\u00147���N��\u0011\u0010-\u0005Q�6\u0012\u0003b�hZTQ�\u0001�\u000F�\u000B���/E*\u0013C�䒻�|\u0017l!�\u0010��\u0016+&�M�\u001A��n�r/r,��<�`� \u0005�\u0004fK\\f����\u0011\u001B�f\u0012�\u000Fz��b�軂=�4� ���o endstream endobj 1 0 obj <> endobj 5 0 obj <> endobj 6 0 obj <> endobj 7 0 obj <> endobj 8 0 obj <> endobj 9 0 obj <> endobj 2 0 obj <> /ExtGState << /GS1 5 0 R >> >> endobj 10 0 obj << /Producer (��mPDF 6.0) /Title (��Krajee Report Title) /CreationDate (20151013165316+02'00') /ModDate (20151013165316+02'00') >> endobj 11 0 obj << /Type /Catalog /Pages 1 0 R /OpenAction [3 0 R /XYZ null null 1] /PageLayout /OneColumn >> endobj xref 0 12 0000000000 65535 f 0000000648 00000 n 0000001201 00000 n 0000000015 00000 n 0000000223 00000 n 0000000737 00000 n 0000000798 00000 n 0000000896 00000 n 0000000992 00000 n 0000001093 00000 n 0000001347 00000 n 0000001521 00000 n trailer << /Size 12 /Root 11 0 R /Info 10 0 R /ID [ ] >> startxref 1631 %%EOF\n\r\n\r\n<bountysource-plugin>\r\n\r\n---\r\nWant to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/27377939-cannot-generate-simple-pdf?utm_campaign=plugin&utm_content=tracker%2F7843555&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F7843555&utm_medium=issues&utm_source=github).\r\n</bountysource-plugin>"},"comment":{"url":"https://api.github.com/repos/kartik-v/yii2-mpdf/issues/comments/427927312","html_url":"https://github.com/kartik-v/yii2-mpdf/issues/24#issuecomment-427927312","issue_url":"https://api.github.com/repos/kartik-v/yii2-mpdf/issues/24","id":427927312,"node_id":"MDEyOklzc3VlQ29tbWVudDQyNzkyNzMxMg==","user":{"login":"JacquesMarques","id":4146048,"node_id":"MDQ6VXNlcjQxNDYwNDg=","avatar_url":"https://avatars3.githubusercontent.com/u/4146048?v=4","gravatar_id":"","url":"https://api.github.com/users/JacquesMarques","html_url":"https://github.com/JacquesMarques","followers_url":"https://api.github.com/users/JacquesMarques/followers","following_url":"https://api.github.com/users/JacquesMarques/following{/other_user}","gists_url":"https://api.github.com/users/JacquesMarques/gists{/gist_id}","starred_url":"https://api.github.com/users/JacquesMarques/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JacquesMarques/subscriptions","organizations_url":"https://api.github.com/users/JacquesMarques/orgs","repos_url":"https://api.github.com/users/JacquesMarques/repos","events_url":"https://api.github.com/users/JacquesMarques/events{/privacy}","received_events_url":"https://api.github.com/users/JacquesMarques/received_events","type":"User","site_admin":false},"created_at":"2018-10-08T18:04:22Z","updated_at":"2018-10-08T18:04:22Z","author_association":"NONE","body":"I  change the mode into 'MODE_UTF8' but not work, put:\r\n\r\nYii::$app->response->format = \\yii\\web\\Response::FORMAT_RAW;\r\nYii::$app->response->headers->add('Content-Type', 'application/pdf');\r\n\r\nWork, but with this I have to put this in many files, is there another solution?"}}
{"actor":{"display_login":"JacquesMarques"}}