Python aracılığıyla PDF Birleştirme

Belgeleri birleştir. PDF dosyalarını programlı olarak değiştirmek için Python for .NET için Aspose.PDF dosyasını kullanın

Python for .NET Kullanarak PDF Dosyaları Nasıl Birleştirilir

PDF dosyalarını birleştirmek için, python-net platformu için özellik açısından zengin, güçlü ve kullanıcı dostu bir belge düzenleme API’si olan Aspose.PDF for Python API’sini kullanacağız. Bu Python kütüphanesi, desteklenen herhangi bir giriş biçiminden desteklenen herhangi bir çıktı biçimine belgelerin dönüştürülmesini destekler. Python için Aspose.PDF kütüphanesi, belge dönüştürmelerini kolaylaştıran kapsamlı çözümler sunar. Hem yükleme hem de kaydetme için çok çeşitli popüler belge biçimlerini destekler. Lütfen bu bölümün yalnızca popüler dönüştürmeleri özetlediğini unutmayın. Bu sayfa, biçimler arasında dönüştürme hakkında bilgi sağlar, ancak dosyalarınızı dönüştürmek için çok sayıda kombinasyon mevcuttur. Desteklenen biçimlerin tam listesi için lütfen Desteklenen Dosya Biçimleri bölümüne bakın. Aspose.PDF for Python’u .NET üzerinden yüklemek için şu adımları izleyin:

  • Komut isteminizi veya terminalinizi açın.
  • Şu komutu çalıştırın:
pip install aspose-pdf

Bu komut, Python uygulamalarınızda PDF dosyalarını düzenlemenize ve birleştirmenize olanak tanıyan Aspose.PDF kitaplığını indirip yükleyecektir. Daha sonra kitaplığı Python betiklerinize aktarabilir ve PDF belgeleriyle çalışmak için kapsamlı özelliklerinden yararlanabilirsiniz.

import aspose.pdf as apdf
from io import FileIO
from os import path
epub_load_options = apdf.EpubLoadOptions()
document_infiles = [
    apdf.Document(path.join(self.dataDir, infile), epub_load_options)
    for infile in infiles
]
path_outfile = path.join(outDir, outfile)
document = apdf.Document.merge_documents(documents=document_infiles)
document.save(path_outfile)
import aspose.pdf as apdf
from io import FileIO
from os import path
html_load_options = apdf.HtmlLoadOptions()
document_infiles = [
    apdf.Document(path.join(self.dataDir, infile), html_load_options)
    for infile in infiles
]
path_outfile = path.join(outDir, outfile)
document = apdf.Document.merge_documents(documents=document_infiles)
document.save(path_outfile)
print(str(infiles) + " merged into " + outfile)
import aspose.pdf as apdf
from io import FileIO
from os import path
md_load_options = apdf.MdLoadOptions()
document_infiles = [
    apdf.Document(path.join(self.dataDir, infile), md_load_options)
    for infile in infiles
]
path_outfile = path.join(outDir, outfile)
document = apdf.Document.merge_documents(documents=document_infiles)
document.save(path_outfile)
import aspose.pdf as apdf
from io import FileIO
from os import path
mhtml_load_options = apdf.MhtLoadOptions()
document_infiles = [
    apdf.Document(path.join(self.dataDir, infile), mhtml_load_options)
    for infile in infiles
]
path_outfile = path.join(outDir, outfile)
document = apdf.Document.merge_documents(documents=document_infiles)
document.save(path_outfile)
print(str(infiles) + " merged into " + outfile)
import aspose.pdf as apdf
from io import FileIO
from os import path
pcl_load_options = apdf.PclLoadOptions()
pcl_load_options.supress_errors = True
document_infiles = [
    apdf.Document(path.join(self.dataDir, infile), pcl_load_options)
    for infile in infiles
]
path_outfile = path.join(outDir, outfile)
document = apdf.Document.merge_documents(documents=document_infiles)
document.save(path_outfile)
import aspose.pdf as apdf
from io import FileIO
from os import path
path_infiles = [path.join(self.dataDir, infile) for infile in infiles]
path_outfile = path.join(outDir, outfile)

document = apdf.Document.merge_documents(files=path_infiles)
document.save(path_outfile)
import aspose.pdf as apdf
from io import FileIO
from os import path
ps_load_options = apdf.PsLoadOptions()
document_infiles = [
    apdf.Document(path.join(self.dataDir, infile), ps_load_options)
    for infile in infiles
]
path_outfile = path.join(outDir, outfile)
document = apdf.Document.merge_documents(documents=document_infiles)
document.save(path_outfile)
import aspose.pdf as apdf
from io import FileIO
from os import path
svg_load_options = apdf.SvgLoadOptions()
document_infiles = [
    apdf.Document(path.join(self.dataDir, infile), svg_load_options)
    for infile in infiles
]
path_outfile = path.join(outDir, outfile)
document = apdf.Document.merge_documents(documents=document_infiles)
document.save(path_outfile)
import aspose.pdf as apdf
from io import FileIO
from os import path
xps_load_options = apdf.XpsLoadOptions()
document_infiles = [
    apdf.Document(path.join(self.dataDir, infile), xps_load_options)
    for infile in infiles
]
path_outfile = path.join(outDir, outfile)
document = apdf.Document.merge_documents(documents=document_infiles)
document.save(path_outfile)