Gunakake API konversi dokumen kanggo ngembangake piranti lunak independen platform tingkat dhuwur ing Python. Iki minangka solusi piranti lunak profesional lengkap kanggo ngimpor lan ngekspor PDF, GIF, lan akeh format dokumen liyane nggunakake Python.
Kudu ngowahi PDF dadi GIF gambar kanthi program? Kanthi Aspose.Words for Python via .NET pangembang bisa gampang ngowahi PDF menyang GIF format gambar mung sawetara baris Python kode.
Modern document-processing Python API nggawe GIF saka PDF kanthi kacepetan dhuwur. Nguji kualitas PDF menyang GIF langsung ing browser. Python kuat ngidini ngowahi PDF akeh format gambar populer.
Conto ing ngisor iki nduduhake carane ngowahi PDF dadi GIF gambar ing Python.
Tindakake langkah sing gampang kanggo nguripake PDF file menyang GIF format grafis. Waca PDF saka drive lokal, banjur simpen minangka GIF, nemtokake format gambar sing dibutuhake dening extension GIF Kanggo loro PDF maca lan GIF nulis sampeyan bisa nggunakake jeneng berkas kanthi qualified. Konten grafis output GIF bakal padha karo PDF file.
pip install aspose-words
Nyalin
import aspose.words as aw
doc = aw.Document("Input.pdf")
save_options = aw.saving.ImageSaveOptions(aw.SaveFormat.GIF)
for page in range(doc.page_count):
save_options.page_set = aw.saving.PageSet(page)
doc.save(f"Output_{page + 1}.gif", save_options)
import aspose.words as aw
doc = aw.Document("Input.pdf")
doc.save("Output.gif")
import aspose.words as aw
doc = aw.Document("Input.pdf")
save_options = aw.saving.ImageSaveOptions(aw.SaveFormat.gif)
for page in range(doc.page_count):
save_options.page_set = aw.saving.PageSet(page)
doc.save(f"Output_{page + 1}.gif", save_options)
import aspose.words as aw
doc = aw.Document()
builder = aw.DocumentBuilder(doc)
builder.insert_image("Input.pdf")
doc.save("Output.gif")
import aspose.words as aw
doc = aw.Document()
builder = aw.DocumentBuilder(doc)
shape = builder.insert_image("Input.pdf")
shape.get_shape_renderer().save("Output.gif", aw.saving.ImageSaveOptions(aw.SaveFormat.gif))
Kita dadi tuan rumah paket Python ing repositori PyPi. Mangga tindakake langkah-langkah dening-instruksi carane nginstal "Aspose.Words for Python via .NET" kanggo lingkungan pangembang.
Paket iki kompatibel karo Python ≥3.5 lan <3.12. Yen sampeyan ngembangake piranti lunak kanggo Linux, deleng syarat tambahan kanggo gcc lan libpython ing Dokumentasi Produk.
Sampeyan bisa ngowahi PDF menyang akeh format file liyane: