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

jQuery clickable div with working mailto link inside -

java - Getting corefrences with Standard corenlp package -

WPF: binding viewmodel property of type DateTime to Calendar inside ItemsControl -