以下の内容はhttps://takuya-1st.hatenablog.jp/entry/2016/11/10/214535より取得しました。


PHP imagick でPDFからJPEG画像をDPI指定で取り出す

imagick で jpg 変換すると画質が悪い

ぱぱっとPDFをJPEGにしようとすると、とても画質が悪い

density オプションを付けたい

convert コマンドで与えるようなオプションを渡すにはどうすればいいのか。

setOption でDPIを渡す

<?php
$imagick = new Imagick();
$imagick->setOption('density',400 );
$imagick->readImage('sample.pdf[0]');
$imagick->writeImage('pageone.jpg');

これで、解像度400dpi の画質で取り出せるので、相当きれいになった。しかもページ番号指定できるのでスキャン画像の処理が楽。

関連資料

ページ番号を指定して取り出す。

<?php
$imagick->readImage('sample.pdf[0]');

image mgacik で pdf を高速に処理する - それマグで!

参考資料

http://php.net/manual/en/class.imagick.php

http://php.net/manual/en/imagick.setoption.php

http://stackoverflow.com/questions/17585457/how-to-change-the-dpi-of-an-image-from-72dpi-to-300dpi-with-imagick




以上の内容はhttps://takuya-1st.hatenablog.jp/entry/2016/11/10/214535より取得しました。
このページはhttp://font.textar.tv/のウェブフォントを使用してます

不具合報告/要望等はこちらへお願いします。
モバイルやる夫Viewer Ver0.14