我尝试了很多事情,但是无法生成白色背景图像,这里我使用pdf文件将其转换为图像。但是它永远不会生成带有pdf页面颜色的图像,它始终是透明的。抱歉,我是Wand的新手。我正在使用png作为格式输入。
with Image(
filename=file_path,
resolution=self.default_resolution,
format=self.format
) as img:
img.compression_quality = self.default_compression
img.save(
filename=path.join(
self.attachment_path,
self.get_file_name_without_type() + self.format
)
)