Advertisement
Guest User

Untitled

a guest
Aug 2nd, 2015
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.53 KB | None | 0 0
  1. <html><head>
  2. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  3. <style type="text/css">
  4. body {
  5. font-family: 'dejavu sans';
  6. direction;rtl;
  7. }
  8. p {
  9. font-size: 2em;
  10. background: #eee;
  11. padding: 1em;
  12. }
  13.  
  14. h2 {
  15. color: #999;
  16. }
  17. </style>
  18. <style type="text/css"></style></head>
  19. <body marginwidth="0" marginheight="0">
  20. <div style="text-align:right">
  21. <h2>Give You Glory</h2>
  22. <br/>
  23. Hadi
  24. </div>
  25. <br/>
  26. هادی
  27. </body></html>
  28.  
  29. cd /tmp/
  30. wget https://github.com/mreiferson/php-wkhtmltox/archive/master.zip
  31. unzip master.zip
  32. cd php-wkhtmltox-master/
  33. phpize
  34. ./configure
  35. sudo make install
  36.  
  37. /usr/lib64/php/modules/
  38.  
  39. extension=phpwkhtmltox.so
  40.  
  41. $ ldconfig
  42.  
  43. <?php
  44.  
  45. /**
  46. * the config_array has lots of options but the two most important are:
  47. * "out" this is the full path to where you want your pdf made
  48. * "imageQuality" basically the same as jpg image quality. lower quality is slower, higher quality is a bigger file
  49. */
  50. $config_array = array( "out" => "/tmp/pdfdocument.pdf",
  51. "imageQuality" => 95);
  52.  
  53. /**
  54. * the array of urls that are the input html for making your pdf. note that these are not files, but urls
  55. * also note that this is an array of arrays keyed by "page"
  56. */
  57. $htmls_array = array(array("page"=>"http://en.wikipedia.org/wiki/Queen's_Gambit_Declined"));
  58.  
  59. /**
  60. * run the conver like so and your pdf file should be on disk
  61. */
  62. wkhtmltox_convert('pdf', $config_array, $htmls_array);
  63.  
  64. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement