Guest User

Untitled

a guest
Jan 23rd, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. // I am pretty sure this one should work, but couldn't find how to do it in php:
  2. convert -density 288 in.pdf -resize 25% out.png
  3.  
  4. // thus this one:
  5. convert -density 600 in.pdf -threshold 15% -type bilevel -compress fax out.pdf
  6.  
  7. // Also found this one:
  8. convert -density 288 image.pdf -resize 25% -threshold 50% -type bilevel image.tiff
  9.  
  10. $img = new Imagick('path/to/document.pdf');
  11. $img->quantizeImage(2, // Number of colors
  12. Imagick::COLORSPACE_GRAY, // Colorspace
  13. 50, // Depth tree
  14. TRUE, // Dither
  15. FALSE); // Error correction
  16. $img->writeImage('path/to/output.png')
Add Comment
Please, Sign In to add comment