PHP converts PDF to PNG format through the imagick library
Release: 2016-07-25 08:43:12
Original
1179 people have browsed it
- function pdf2png($PDF,$Path){
- if(!extension_loaded('imagick')){
- return false;
- }
- if(!file_exists($PDF)){
- return false;
- }
- $IM = new imagick();
- $IM->setResolution(120,120);
- $IM->setCompressionQuality(100);
- $IM->readImage($PDF);
- foreach ($IM as $Key => $Var){
- $Var->setImageFormat('png');
- $Filename = $Path.'/'.md5($Key.time()).'.png';
- if($Var->writeImage($Filename) == true){
- $Return[] = $Filename;
- }
- }
- return $Return;
- }
复制代码
|
转成, imagick, php
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
-
2024-08-24 16:47:09
-
2024-08-24 16:46:28
-
2024-08-24 16:45:32
-
2024-08-24 16:45:11
-
2024-08-24 16:44:28
-
2024-08-24 16:43:03
-
2024-08-24 16:42:31
-
2024-08-24 16:41:22
-
2024-08-24 16:41:08
-
2024-08-24 16:39:32