IronPDF for Java - Java Uygulamalarında PDF Oluşturma, Düzenleme ve Okuma

This article was translated from English: Does it need improvement?
Translated
View the article in English

IronPDF for Java Hakkında

IronPDF for Java, Iron Software tarafından geliştirilmiş ve bakımı sağlanan, Java 8+, Kotlin, ve Scala projelerinde yazılım mühendislerinin PDF içeriği oluşturmasına, düzenlemesine ve çıkartmasına yardımcı olan bir kütüphanedir.

IronPDF for Java, IronPDF for .NET'in başarısı ve popülerliğine dayanır.

IronPDF for Java, IronPdfEngine ile iletişim kurmak için gRPC kullanır.

IronPDF'ün Başardıkları

  • Aşağıdaki kaynaklardan PDF oluşturma: HTML, URL, JavaScript, CSS ve birçok resim formatı
  • Üstbilgi/altbilgi, imza, ek, parola ve güvenlik ekleme
  • Performans optimizasyonu: Tam multitasking ve Asenkron destek
  • Ve çok daha fazlası! Kod örneklerimizin tamamını ve 50+ özelliklerimizin tam listesini görmek için web sitemizi ziyaret edin

Java için IronPDF Kullanarak

IronPDF'yi Java Bağımlılığı Olarak Tanımlama

pom.xml Bağımlılık

IronPDF'i bir bağımlılık olarak tanımlamak için lütfen aşağıdakini pom.xml ekleyin:

<dependencies>

    <dependency>
        <groupId>com.ironsoftware</groupId>
        <artifactId>ironpdf</artifactId>
        <version>20xx.xx.xxxx</version>
    </dependency>

    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-simple</artifactId>
        <version>2.0.3</version>
    </dependency>

</dependencies>
<dependencies>

    <dependency>
        <groupId>com.ironsoftware</groupId>
        <artifactId>ironpdf</artifactId>
        <version>20xx.xx.xxxx</version>
    </dependency>

    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-simple</artifactId>
        <version>2.0.3</version>
    </dependency>

</dependencies>
XML

jar dosyasını indir

Bağımsız kullanım için IronPDF JAR dosyasını manuel olarak indirmeyi tercihe bağlı yapabilirsiniz.

İlk Kurulum ve Çalıştırma

Projeyi ilk kez çalıştırırken IronPdfEngine ikili dosyalar otomatik olarak indirilecektir. Herhangi bir IronPdf işlevini ilk kez çağırdığınızda IronPdfEngine süreci başlayacak ve uygulamanız kapandığında veya işlem boşa geçtiğinde duracaktır.

Maven Bağımlılığı Olarak IronPDF Motorunu Yükleyin

IronPdfEngine'i bir Maven bağımlılığı olarak ekleyerek, ikili dosyalar bağımlılıkların yüklenmesi sırasında indirilecektir:

  • Bu yaklaşım, IronPdfEngine ikili dosyaları zaten indirileceği için uzun bir başlangıç sürecinden kaçınmanıza yardımcı olacaktır.
  • Ayrıca, harici kaynaklardan indirmeye izin vermeyen dağıtım yapılandırmaları için faydalı olacaktır.

Çok platformlu bir uygulama üzerinde çalışıyorsanız, aşağıdaki kod parçacıklarından bir veya daha fazlasını pom.xml dosyanıza ekleyin:

Windows x64 için

<dependency>
    <groupId>com.ironsoftware</groupId>
    <artifactId>ironpdf-engine-windows-x64</artifactId>
    <version>20xx.xx.xxxx</version>
</dependency>
<dependency>
    <groupId>com.ironsoftware</groupId>
    <artifactId>ironpdf-engine-windows-x64</artifactId>
    <version>20xx.xx.xxxx</version>
</dependency>
XML

Windows x86 için

<dependency>
    <groupId>com.ironsoftware</groupId>
    <artifactId>ironpdf-engine-windows-x86</artifactId>
    <version>20xx.xx.xxxx</version>
</dependency>
<dependency>
    <groupId>com.ironsoftware</groupId>
    <artifactId>ironpdf-engine-windows-x86</artifactId>
    <version>20xx.xx.xxxx</version>
</dependency>
XML

Linux x64 için

<dependency>
    <groupId>com.ironsoftware</groupId>
    <artifactId>ironpdf-engine-linux-x64</artifactId>
    <version>20xx.xx.xxxx</version>
</dependency>
<dependency>
    <groupId>com.ironsoftware</groupId>
    <artifactId>ironpdf-engine-linux-x64</artifactId>
    <version>20xx.xx.xxxx</version>
</dependency>
XML

macOS x64 (Intel) için

<dependency>
    <groupId>com.ironsoftware</groupId>
    <artifactId>ironpdf-engine-macos-x64</artifactId>
    <version>20xx.xx.xxxx</version>
</dependency>
<dependency>
    <groupId>com.ironsoftware</groupId>
    <artifactId>ironpdf-engine-macos-x64</artifactId>
    <version>20xx.xx.xxxx</version>
</dependency>
XML

macOS Arm (Apple Silicon) için

<dependency>
    <groupId>com.ironsoftware</groupId>
    <artifactId>ironpdf-engine-macos-arm64</artifactId>
    <version>20xx.xx.xxxx</version>
</dependency>
<dependency>
    <groupId>com.ironsoftware</groupId>
    <artifactId>ironpdf-engine-macos-arm64</artifactId>
    <version>20xx.xx.xxxx</version>
</dependency>
XML

Java kodu yazmaya başlayın

Bağımlılık tanımlandıktan sonra, Java kodunuzun üst kısmına import com.ironsoftware.ironpdf.* ifadesini ekleyerek başlayabilirsiniz. Başlangıç için basit bir HTML'den PDF'ye örneği burada:

// Import statement for IronPDF Java
import com.ironsoftware.ironpdf.*;

// Apply your license key
License.setLicenseKey("YOUR-LICENSE-KEY");

// Set a log path
Settings.setLogPath(Paths.get("C:/tmp/IronPdfEngine.log"));

// Render the HTML as a PDF. Stored in myPdf as type PdfDocument
PdfDocument myPdf = PdfDocument.renderHtmlAsPdf("<h1> ~Hello World~ </h1> Made with IronPDF!");

// Save the PdfDocument to a file
myPdf.saveAs(Paths.get("html_saved.pdf"));
// Import statement for IronPDF Java
import com.ironsoftware.ironpdf.*;

// Apply your license key
License.setLicenseKey("YOUR-LICENSE-KEY");

// Set a log path
Settings.setLogPath(Paths.get("C:/tmp/IronPdfEngine.log"));

// Render the HTML as a PDF. Stored in myPdf as type PdfDocument
PdfDocument myPdf = PdfDocument.renderHtmlAsPdf("<h1> ~Hello World~ </h1> Made with IronPDF!");

// Save the PdfDocument to a file
myPdf.saveAs(Paths.get("html_saved.pdf"));
JAVA

Bu, URL'den PDF'ye donusumu gösteren baska bir basit örnektir:

// Import statement for IronPDF Java
import com.ironsoftware.ironpdf.*;

// Apply your license key
License.setLicenseKey("YOUR-LICENSE-KEY");

// Set a log path
Settings.setLogPath(Paths.get("C:/tmp/IronPdfEngine.log"));

// Render the URL as a PDF. Stored in myPdf as type PdfDocument
PdfDocument myPdf = PdfDocument.renderUrlAsPdf("https://ironpdf.com/java");

// Save the PdfDocument to a file
myPdf.saveAs(Paths.get("url_saved.pdf"));
// Import statement for IronPDF Java
import com.ironsoftware.ironpdf.*;

// Apply your license key
License.setLicenseKey("YOUR-LICENSE-KEY");

// Set a log path
Settings.setLogPath(Paths.get("C:/tmp/IronPdfEngine.log"));

// Render the URL as a PDF. Stored in myPdf as type PdfDocument
PdfDocument myPdf = PdfDocument.renderUrlAsPdf("https://ironpdf.com/java");

// Save the PdfDocument to a file
myPdf.saveAs(Paths.get("url_saved.pdf"));
JAVA

Butun Main.java Ornegi

package org.example;

// Import statement for IronPDF Java
import com.ironsoftware.ironpdf.*;
import java.io.IOException;
import java.nio.file.Paths;

public class Main {

    public static void main(String[] args) throws IOException {
        // Apply your license key
        License.setLicenseKey("YOUR-LICENSE-KEY");

        // Set a log path
        Settings.setLogPath(Paths.get("C:/tmp/IronPdfEngine.log"));

        // Render the HTML as a PDF. Stored in myPdf as type PdfDocument
        PdfDocument myPdf = PdfDocument.renderHtmlAsPdf("<h1> ~Hello World~ </h1> Made with IronPDF!");

        // Save the PdfDocument to a file
        myPdf.saveAs(Paths.get("html_saved.pdf"));

    }

}
package org.example;

// Import statement for IronPDF Java
import com.ironsoftware.ironpdf.*;
import java.io.IOException;
import java.nio.file.Paths;

public class Main {

    public static void main(String[] args) throws IOException {
        // Apply your license key
        License.setLicenseKey("YOUR-LICENSE-KEY");

        // Set a log path
        Settings.setLogPath(Paths.get("C:/tmp/IronPdfEngine.log"));

        // Render the HTML as a PDF. Stored in myPdf as type PdfDocument
        PdfDocument myPdf = PdfDocument.renderHtmlAsPdf("<h1> ~Hello World~ </h1> Made with IronPDF!");

        // Save the PdfDocument to a file
        myPdf.saveAs(Paths.get("html_saved.pdf"));

    }

}
JAVA

Daha Fazla Ayar Bilgisi

Not: Tüm ayarlar, loglama ve lisanslama işlemleri, herhangi bir IronPDF yöntemi cagrilmadan once gerceklestirilmelidir.

Lisans Anahtari Uygulama

Lisans anahtarinizi uygulamak icin, yönteminizin basina asagidaki kodu ekleyin:

com.ironsoftware.ironpdf.License.setLicenseKey("YOUR-LICENSE-KEY");
com.ironsoftware.ironpdf.License.setLicenseKey("YOUR-LICENSE-KEY");
JAVA

Kaydetme

IronPDF Java, loglama amaclari icin slf4j loglayici kullanir. Loglamayi etkinlestirmek icin su kodu kullanin:

com.ironsoftware.ironpdf.Settings.setDebug(true);
com.ironsoftware.ironpdf.Settings.setDebug(true);
JAVA

IronPdfEngine günlük yolunu belirtmek için ekleyin:

com.ironsoftware.ironpdf.Settings.setLogPath(Paths.get("C:/tmp/myIronPdfEngineLog.log"));
com.ironsoftware.ironpdf.Settings.setLogPath(Paths.get("C:/tmp/myIronPdfEngineLog.log"));
JAVA

Lisanslama ve Destek Mevcut

IronPDF icin lisans satin alin canli projelerde kullanmak icin. 30 günlük Deneme lisanslari deneme kullanicilari icin de mevcuttur.

Tüm kod örneklerimiz, derslerimiz, lisans bilgileri ve belgelerimiz icin sunu ziyaret edin: IronPDF for Java kaynaklari.

Daha fazla destek ve sorular icin destek ekibimizle iletişime geçin.

Darrius Serrant
Tam Yığın Yazılım Mühendisi (WebOps)

Darrius Serrant, Miami Üniversitesi'nden Bilgisayar Bilimleri lisans derecesine sahiptir ve Iron Software'de Tam Yığın WebOps Pazarlama Mühendisi olarak çalışmaktadır. Küçük yaşlardan itibaren kodlamaya ilgi duyan Darrius, bilişimi hem gizemli hem de erişilebilir buldu ve onu yaratıcılık ve problem çö...

Daha Fazlasını Oku
Başlamaya Hazır mısınız?
Sürüm: 2026.4 yeni yayınlandı
Still Scrolling Icon

Hala Kaydiriyor musunuz?

Hızlı bir kanit mi istiyorsunuz?
bir örnek çalıştır HTML'nizin PDF olduğunu izleyin.