php - convert pdf to transparent png -


i'm using imagemagick convert pdf file png (thumbnail) image, , works well. i'm wondering whether it's possible convert pdf, has white background, png file transparent background (i.e. set white pixels transparent).

this php code i'm using (which results in png file white background):

/* open first page of pdf file */ $im = new imagick($pdf_filepath . '[0]');  /* scale */ $im->thumbnailimage($width, $height);  /* convert png */ $im->setimageformat('png');  /* save file */ $result = $im->writeimage($thumbnail_filepath); 

check out: http://imagemagick.org/usage/channels/#mask_creation

i think have create gif first , png if wish.


Comments

Popular posts from this blog

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

apache - Add omitted ? to URLs -

php - How can I stop spam on my custom forum/blog? -