jpg ' 46 image.save(name)Ĥ8 name = " %s/%s " % (static_host, name) 17 with img.convert( ' png ' ) as converted:ġ8 path = ' static/local_images/%s.png ' % titleĢ2 path = ' static/local_images/%s.png ' % titleĢ7 path = ' static/local_images/%s-%d.png ' % (title, i)ģ3 background = Image2.new( ' RGBA ', image.size, (255,255,255 ))ģ6 background.paste(image, (0, 0, x, y), image)Ĥ0 background.paste(image, (0, 0, x, y), image)Ĥ5 name = title + '. ')) + 1ĩ 10 # resolution For resolution, background Background color 11 with Image(filename=filename, resolution=150, background=Color( ' White ' )) as img :ġ2 13 # The number of pages 14 length = len(img.sequence)ġ5 16 # If the number of pages exceeds 1 page, the number of pages will be added to the generated file name in turn. Transfer to png and jpg is to avoid black, transparent background, resulting in the conversion of pictures and pdf file display is different 1 from PIL import Image as Image2Ħ end_length = len(filename.split( '. Install libreoffice (this tool is used to convert word documents into pdf files) Install imagemagick(pdf to jpg is internal need to call this tool)
0 Comments
Leave a Reply. |