Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html><head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <style type="text/css">
- body {
- font-family: 'dejavu sans';
- direction;rtl;
- }
- p {
- font-size: 2em;
- background: #eee;
- padding: 1em;
- }
- h2 {
- color: #999;
- }
- </style>
- <style type="text/css"></style></head>
- <body marginwidth="0" marginheight="0">
- <div style="text-align:right">
- <h2>Give You Glory</h2>
- <br/>
- Hadi
- </div>
- <br/>
- هادی
- </body></html>
- cd /tmp/
- wget https://github.com/mreiferson/php-wkhtmltox/archive/master.zip
- unzip master.zip
- cd php-wkhtmltox-master/
- phpize
- ./configure
- sudo make install
- /usr/lib64/php/modules/
- extension=phpwkhtmltox.so
- $ ldconfig
- <?php
- /**
- * the config_array has lots of options but the two most important are:
- * "out" this is the full path to where you want your pdf made
- * "imageQuality" basically the same as jpg image quality. lower quality is slower, higher quality is a bigger file
- */
- $config_array = array( "out" => "/tmp/pdfdocument.pdf",
- "imageQuality" => 95);
- /**
- * the array of urls that are the input html for making your pdf. note that these are not files, but urls
- * also note that this is an array of arrays keyed by "page"
- */
- $htmls_array = array(array("page"=>"http://en.wikipedia.org/wiki/Queen's_Gambit_Declined"));
- /**
- * run the conver like so and your pdf file should be on disk
- */
- wkhtmltox_convert('pdf', $config_array, $htmls_array);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement