Aspose.PDF for Python'u .NET aracılığıyla Çalıştırmak için Python'u Kurma

Bu konuda Python’un Aspose.Pdf for Python’u .NET aracılığıyla çalıştırmak için nasıl kurulacağına ilişkin ayrıntılı adımlar yer almaktadır. Microsoft Windows, Linux veya macOS tabanlı işletim sistemlerinden herhangi birinde yapılandırılmış .NET Framework’e sahip olduğunuz kabul edilir ve Python’da Aspose.Pdf kodunu çalıştırmak için gerekli tüm yazılımları yüklemeniz için sizi yönlendirir. Bu adımlar sırasında Python’u yükleyeceğiz ve ortamı doğrulamak için yeni bir PDF dosyası oluşturacağız.

Aspose.Pdf for Python’u .NET aracılığıyla Çalıştırmak için Python’u Kurma Adımları

  1. .NET framework desteği ile yapılandırılmış bir Microsoft Windows, Linux veya macOS işletim sistemine sahip olduğunuz kabul edilir. Daha fazla bilgi için Install .NET on Windows, Linux, and macOS adresini ziyaret edebilirsiniz.
  2. Python uzantısını VS Koduna kurun
  3. Python 3.9.6 yükleyin
  4. Pip komutunu yükleyin
  5. Pip kullanarak en son Aspose.Pdf for Python via .NET sürümünü yükleyin
  6. Bir PDF dosyası oluşturmak için Python için Aspose-Pdf kodunu oluşturun ve yürütün

İlk iki adımı karşılayan ortamı zaten oluşturduysanız, bunları yok sayabilir ve Windows, Linux veya macOS ortamınızdaki terminalde veya komut isteminde sonraki komutlara geçebilirsiniz. Aspose.Pdf’i kurmak için Python ve Pip3’ü kurmanız gerekir.

Aspose.Pdf for Python’u .NET aracılığıyla Çalıştırmak için Python’u Kurmak İçin Komut Dosyası

1. Install .NET Framework (Required for Ubuntu only)
#For Ubuntu
apt update
apt upgrade
apt install sudo
sudo apt update
sudo apt install wget
wget -q https://packages.microsoft.com/config/ubuntu/19.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
sudo apt-get update
sudo apt-get install apt-transport-https
sudo apt-get update
sudo apt-get install dotnet-sdk-3.1
2. Install Python 3.9.6
#For Ubuntu
sudo apt install -y python3.9
# For MS Windows and macOS
install using MSI or DMG package. Be sure to select the check box to set the path during the installation
3. Installing Pip Command
# For Ubuntu
sudo apt install python3-pip
# For Windows and Mac
python3 -m pip install --upgrade pip
4. Install Aspose.Pdf
python3 -m pip install aspose-pdf
# Additional requirements for Ubuntu to install libgdiplus and libc6-dev
# For Ubuntu only
apt-get update
apt-get install -y libgdiplus
cd /usr/lib && ln -s libgdiplus.so gdiplus.dll
apt-get install -y --no-install-recommends libc6-dev
5. Write a sample program and save it as SamplePdf.Py and execute the Program
python3 SamplePdf.py
import aspose.pdf as pdf
# Create the empty PDF file
pdfDocument = pdf.Document()
# Insert the page in the PDF
pdfPage = pdfDocument.pages.add()
# Save the PDF on the disk
pdfDocument.save("GeneratedPdf.pdf")
print("Process completed")
6. Run the sample using the following command
python3 SamplePdf.py

.NET Framework, Python 3.9.6 ve PIP ortamınızda zaten kuruluysa, API’yi kullanmak için 5. Adımdan itibaren başlayabilirsiniz. Daha eski Python2.x sürümleri yerine API ile Python 3.9.6 kullanılması önerilir.

Kurulumu doğrulamak için API’yi kullanan temel bir çalışan örnek kod da sağlanmıştır. API kullanarak üretmek istediğiniz farklı örneklerle çalışmak için diğer örnekleri kullanabilir ve API özelliklerini keşfedebilirsiniz.

 Türkçe