Saving Each PDF Page to an Image Using Imagick

后端 未结 4 745
生来不讨喜
生来不讨喜 2020-12-29 07:49

I have the following php function below that\'s converting a local PDF file into images. In short, I want each PDF page to be converted to a separate image.

The func

4条回答
  •  一整个雨季
    2020-12-29 08:47

    Seems like most of my code was correct. The issue was, I was using $img->flattenImages(); incorrectly. This merges a sequence of images into one image. Much like how Photoshop flattens all visible layers into an image when exporting a jpg.

    I removed the above line and the individual files were written as expected.

提交回复
热议问题