code:def abc():
file_path = ‘aaaa.pdf’
document = ap.Document(file_path)
img_dmc_ids = []
for pdfPage in document.pages:
image_list = pdfPage.resources.images
img_base_path = file_path[:file_path.rfind(‘.pdf’)]
img_base_path = f"{img_base_path}_output"
if not os.path.exists(img_base_path):
os.makedirs(img_base_path)
for image in image_list:
# print(image)
try:
image_format = str(image.grayscaled.raw_format).lower()
except:
image_format = “png”
image_name = ‘aaa’ + ‘.’ + image_format
image_path = img_base_path + ‘/’ + image_name
outputImage = io.FileIO(image_path, “w”)
# Save output image
image.save(outputImage, ImageFormat.png)
outputImage.close()
# img_dmc_id = self.upload__StreamWrapperfile(image_name, image_path)
# img_dmc_ids.append(img_dmc_id)
return img_dmc_ids error: File “/root/project/kcf_dl_backend/app/service/aiService/a.py”, line 30, in abc
image.save(outputImage, ImageFormat.png)
RuntimeError: Proxy error(NotImplementedException): Not supported image type
in windows,it’s running normaly,in linux,error
Can you please share which API version are you using? Have you tried installing libgdiplus package in Linux as well?
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.
Issue ID(s): PDFPYTHON-307
You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.