跳至页脚内容
产品比较
IronPDF和Apache PDFBox在Java中将HTML转换为PDF的比较

IronPDF for Java 与 Apache PDFBox 的比较

本文将介绍在Java中处理PDF文件的两大最受欢迎的库:

  1. IronPDF
  2. Apache PDFBox

现在我们应该使用哪个库? 在本文中,我将比较两个库的核心功能,以帮助您决定哪个最适合您的生产环境。

IronPDF。

IronPDF 库支持Java 8+、Kotlin和Scala的HTML到PDF转换。 此创建者提供跨平台支持,即Windows、Linux或云平台。 它特别为Java设计,优先考虑准确性、易用性和速度。

IronPDF开发的目的是帮助软件开发人员创建、编辑和提取PDF文档中的内容。 它基于IronPDF for .NET的成功和受欢迎。

IronPDF 的突出功能包括

使用HTML资产

  • HTML(5及以下)、CSS(屏幕和打印)、图像(JPG、PNG、GIF、TIFF、SVG、BMP)、JavaScript(+渲染延迟)
  • 字体(网络和图标)

HTML到PDF

  • HTML文件/字符串到PDF文档的创建和操作
  • URL到PDF

转换图像

  • 图像到新PDF文档
  • PDF到图像

自定义纸张设置

  • 自定义纸张尺寸、方向和旋转
  • 边距(毫米、英寸和零)
  • 彩色和灰度、分辨率和JPEG质量

附加功能

  • 网站和系统登录
  • 自定义用户代理和代理服务器
  • HTTP头

Apache PDFBox库

Apache PDFBox是一个用于处理PDF文件的开源Java库。 它允许生成、编辑和操作现有文档。 它还可以从文件中提取内容。 该库提供了多种实用工具,用于对文档执行各种操作。

以下是Apache PDFBox的突出特点。

提取文本

  • 从文件中提取Unicode文本。

拆分与合并

  • 将单个PDF拆分成多个文件
  • 合并多个文档。

填写表单

  • 从表单中提取数据
  • 填写PDF表单。

预检

  • 根据PDF/A-1b标准对文件进行验证。

打印

  • 使用标准打印API打印PDF。

保存为图像

  • 将PDF保存为PNG、JPEG或其他图像类型。

创建PDF

  • 从头开始开发一个包含嵌入字体和图像的PDF。

签名

  • 数字签署文件。

概述

文章的其余部分如下:

  1. IronPDF 安装
  2. Apache PDFBox安装
  3. 创建PDF文档
  4. 图像到文档
  5. 加密文档
  6. 授权 7.结论

现在我们将下载并安装库以比较它们强大的功能。

1.IronPDF 安装。

安装IronPDF for Java很简单。 有多种方法可以执行此操作。 本节将演示两种最流行的方法。

1.1. 下载JAR并添加库

要下载IronPDF JAR文件,请访问Maven网站的IronPDF并下载最新版本的IronPDF。

  • 单击"下载"选项并下载JAR。
A Comparison between IronPDF For Java and Apache PDF Box for Java - Figure 1: 下载 IronPdf JAR

下载 IronPdf JAR

下载JAR后,现在是时候将库安装到我们的Maven项目中。 您可以使用任何IDE,但我们将使用NetBeans。 在项目部分:

  • 右键单击"Libraries"文件夹并选择Add JAR/Folder选项。
A Comparison between IronPDF For Java and Apache PDF Box for Java - Figure 2: 在 Netbeans 中添加 IronPdf 库

在 Netbeans 中添加 IronPdf 库

  • 转到您下载JAR的文件夹。
  • 选择IronPDF JAR并单击"打开"按钮。
A Comparison between IronPDF For Java and Apache PDF Box for Java - Figure 3: 打开 IronPdf JAR

打开 IronPdf JAR

1.2. 通过Maven作为依赖项安装

下载和安装IronPDF的另一种方法是使用Maven。 您可以简单地在pom.xml中添加依赖项或使用NetBeans的依赖项工具将其包含在项目中。

在pom.xml中添加库依赖项

在您的pom.xml中添加以下依赖项:

<dependencies>
  <dependency>
    <groupId>com.ironsoftware</groupId>
    <artifactId>ironpdf</artifactId>
    <version>YOUR_VERSION_HERE</version>
  </dependency>
</dependencies>
<dependencies>
  <dependency>
    <groupId>com.ironsoftware</groupId>
    <artifactId>ironpdf</artifactId>
    <version>YOUR_VERSION_HERE</version>
  </dependency>
</dependencies>
XML

使用依赖功能添加库

  • 右键点击dependencies
  • 选择"添加依赖项",并用最新版本填写以下详细信息
A Comparison between IronPDF For Java and Apache PDF Box for Java - Figure 4: 添加 IronPDF 依赖

添加 IronPDF 依赖

现在让我们安装Apache PDFBox。

2. Apache PDFBox安装

我们可以使用与IronPDF相同的方法下载和安装PDFBox。

2.1. 下载JAR并手动添加库

要安装PDFBox JAR,请访问官方网站并下载PDFBox库的最新版本。

在创建项目后,在项目部分:

  • 右键单击"Libraries"文件夹并选择Add JAR/Folder选项。
A Comparison between IronPDF For Java and Apache PDF Box for Java - Figure 5: 添加库

添加库

  • 转到您下载JAR的文件夹。
  • 选中PDFBox JAR并点击"打开"按钮。
A Comparison between IronPDF For Java and Apache PDF Box for Java - Figure 6: 打开 PDFBox JAR

打开 PDFBox JAR

2.2. 通过Maven作为依赖项安装

在pom.xml中添加依赖项

复制以下代码并粘贴到pom.xml中。

<dependencies>
    <dependency>  
        <groupId>org.apache.pdfbox</groupId>
        <artifactId>pdfbox-app</artifactId>
        <version>3.0.0-alpha3</version>
    </dependency>
</dependencies>
<dependencies>
    <dependency>  
        <groupId>org.apache.pdfbox</groupId>
        <artifactId>pdfbox-app</artifactId>
        <version>3.0.0-alpha3</version>
    </dependency>
</dependencies>
XML

这将自动下载PDFBox依赖项并将其安装到存储库文件夹中。 现在它就可以使用了。

使用依赖功能添加依赖项

  • 在项目部分右键依赖项
  • 选择"添加依赖项",并用最新版本填写以下详细信息
A Comparison between IronPDF For Java and Apache PDF Box for Java - Figure 7: 添加 PDFBox 依赖关系

添加 PDFBox 依赖关系

3. 创建PDF文档

3.1.使用 IronPDF.

IronPDF提供了不同的方法来创建文件。 让我们看看两个最重要的方法。

将现有 URL 转换为 PDF.

IronPDF使从HTML生成文档变得非常简单。 下面的代码示例将网页的URL转换为PDF。

import com.ironsoftware.ironpdf.*;
import java.nio.file.Paths;

// Set the license key and log path
License.setLicenseKey("YOUR-LICENSE-KEY");
Settings.setLogPath(Paths.get("C:/tmp/IronPdfEngine.log"));

// Convert a URL to a PDF
PdfDocument myPdf = PdfDocument.renderUrlAsPdf("https://ironpdf.com");

// Save the PDF document to a file
myPdf.saveAs(Paths.get("url.pdf"));
import com.ironsoftware.ironpdf.*;
import java.nio.file.Paths;

// Set the license key and log path
License.setLicenseKey("YOUR-LICENSE-KEY");
Settings.setLogPath(Paths.get("C:/tmp/IronPdfEngine.log"));

// Convert a URL to a PDF
PdfDocument myPdf = PdfDocument.renderUrlAsPdf("https://ironpdf.com");

// Save the PDF document to a file
myPdf.saveAs(Paths.get("url.pdf"));
JAVA

输出是以下URL,格式良好并保存如下:

A Comparison between IronPDF For Java and Apache PDF Box for Java - Figure 8: IronPdf URL 输出

IronPdf URL 输出

将 HTML 输入字符串转换为 PDF 文件

以下示例代码展示了如何使用HTML字符串在Java中渲染PDF。 您可以简单地使用HTML字符串或文档来将其转换为新文档。

import com.ironsoftware.ironpdf.*;
import java.nio.file.Paths;

// Set the license key and log path
License.setLicenseKey("YOUR-LICENSE-KEY");
Settings.setLogPath(Paths.get("C:/tmp/IronPdfEngine.log"));

// Convert an HTML string to a PDF
PdfDocument myPdf = PdfDocument.renderHtmlAsPdf("<h1> ~Hello World~ </h1> Made with IronPDF!");

// Save the PDF document to a file
myPdf.saveAs(Paths.get("html_saved.pdf"));
import com.ironsoftware.ironpdf.*;
import java.nio.file.Paths;

// Set the license key and log path
License.setLicenseKey("YOUR-LICENSE-KEY");
Settings.setLogPath(Paths.get("C:/tmp/IronPdfEngine.log"));

// Convert an HTML string to a PDF
PdfDocument myPdf = PdfDocument.renderHtmlAsPdf("<h1> ~Hello World~ </h1> Made with IronPDF!");

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

译文如下:

A Comparison between IronPDF For Java and Apache PDF Box for Java - Figure 9: IronPdf HTML 输出

IronPdf HTML 输出

3.2. 使用Apache PDFBox

PDFBox也可以从不同的格式生成新的PDF文档,但它不能直接从URL或HTML字符串转换。

以下代码示例创建了一个带有一些文本的文档:

import org.apache.pdfbox.pdmodel.*;
import org.apache.pdfbox.pdmodel.common.*;
import org.apache.pdfbox.pdmodel.font.*;
import org.apache.pdfbox.pdmodel.graphics.image.*;
import org.apache.pdfbox.pdmodel.interactive.annotation.*;
import org.apache.pdfbox.pdmodel.interactive.form.*;

import java.io.IOException;

public class PDFBoxExample {

  public static void main(String[] args) throws IOException {

    // Create a document object
    PDDocument document = new PDDocument();

    // Add a blank page to the document
    PDPage blankPage = new PDPage();
    document.addPage(blankPage);

    // Retrieve the page of the document 
    PDPage paper = document.getPage(0);
    try (PDPageContentStream contentStream = new PDPageContentStream(document, paper)) {
      // Begin the content stream 
      contentStream.beginText();

      // Set the font to the content stream  
      contentStream.setFont(PDType1Font.TIMES_ROMAN, 12);

      // Set the position for the line 
      contentStream.newLineAtOffset(25, 700);

      String text = "This is the sample document and we are adding content to it.";

      // Add text in the form of a string 
      contentStream.showText(text);      

      // End the content stream
      contentStream.endText();

      System.out.println("Content added");

      // Save the document
      document.save("C:/PdfBox_Examples/my_doc.pdf");
      System.out.println("PDF created");
    }
    // Closing the document
    document.close();
  }
}
import org.apache.pdfbox.pdmodel.*;
import org.apache.pdfbox.pdmodel.common.*;
import org.apache.pdfbox.pdmodel.font.*;
import org.apache.pdfbox.pdmodel.graphics.image.*;
import org.apache.pdfbox.pdmodel.interactive.annotation.*;
import org.apache.pdfbox.pdmodel.interactive.form.*;

import java.io.IOException;

public class PDFBoxExample {

  public static void main(String[] args) throws IOException {

    // Create a document object
    PDDocument document = new PDDocument();

    // Add a blank page to the document
    PDPage blankPage = new PDPage();
    document.addPage(blankPage);

    // Retrieve the page of the document 
    PDPage paper = document.getPage(0);
    try (PDPageContentStream contentStream = new PDPageContentStream(document, paper)) {
      // Begin the content stream 
      contentStream.beginText();

      // Set the font to the content stream  
      contentStream.setFont(PDType1Font.TIMES_ROMAN, 12);

      // Set the position for the line 
      contentStream.newLineAtOffset(25, 700);

      String text = "This is the sample document and we are adding content to it.";

      // Add text in the form of a string 
      contentStream.showText(text);      

      // End the content stream
      contentStream.endText();

      System.out.println("Content added");

      // Save the document
      document.save("C:/PdfBox_Examples/my_doc.pdf");
      System.out.println("PDF created");
    }
    // Closing the document
    document.close();
  }
}
JAVA
A Comparison between IronPDF For Java and Apache PDF Box for Java - Figure 10: PDFBox 定位输出

PDFBox 定位输出

然而,如果在上述代码示例中移除contentStream.newLineAtOffset(25, 700);然后运行项目,它会生成一个输出在页面底部的PDF。 这对于某些开发人员来说可能会感到相当烦人,因为他们必须使用(x,y)坐标来调整文本。 y = 0意味着文本将出现在底部。

A Comparison between IronPDF For Java and Apache PDF Box for Java - Figure 11: 无定位输出的 PDFBox

无定位输出的 PDFBox

4. 图像到文档

4.1. 使用IronPDF

IronPDF可以轻松地将多个图像转换为一个单独的PDF。 将多个图像添加到单个文档的代码如下:

import com.ironsoftware.ironpdf.*;
import java.nio.file.*;
import java.util.ArrayList;  
import java.util.List;

// Reference to the directory containing the images that we desire to convert
List<Path> images = new ArrayList<>();
images.add(Paths.get("imageA.png"));
images.add(Paths.get("imageB.png"));
images.add(Paths.get("imageC.png"));
images.add(Paths.get("imageD.png"));
images.add(Paths.get("imageE.png"));

// Render all targeted images as PDF content and save them together in one document.
PdfDocument merged = PdfDocument.fromImage(images);
merged.saveAs(Paths.get("output.pdf"));
import com.ironsoftware.ironpdf.*;
import java.nio.file.*;
import java.util.ArrayList;  
import java.util.List;

// Reference to the directory containing the images that we desire to convert
List<Path> images = new ArrayList<>();
images.add(Paths.get("imageA.png"));
images.add(Paths.get("imageB.png"));
images.add(Paths.get("imageC.png"));
images.add(Paths.get("imageD.png"));
images.add(Paths.get("imageE.png"));

// Render all targeted images as PDF content and save them together in one document.
PdfDocument merged = PdfDocument.fromImage(images);
merged.saveAs(Paths.get("output.pdf"));
JAVA
A Comparison between IronPDF For Java and Apache PDF Box for Java - Figure 12: IronPdf 图像输出

IronPdf 图像输出

4.2. 使用Apache PDFBox

import org.apache.pdfbox.pdmodel.*;
import org.apache.pdfbox.pdmodel.graphics.image.*;
import java.io.IOException;
import java.nio.file.*;
import java.util.ArrayList;
import java.util.List;

public class ImageToPdf {

  public static void main(String[] args) {

    // Reference to the directory containing the images that we desire to convert
    Path imageDirectory = Paths.get("assets/images");

    // Create an empty list to contain Paths to images from the directory.
    List<Path> imageFiles = new ArrayList<>();

    PDDocument doc = new PDDocument();

    // Use a DirectoryStream to populate the list with paths for each image in the directory that we want to convert
    try (DirectoryStream<Path> stream = Files.newDirectoryStream(imageDirectory, "*.{png,jpg}")) {

      for (Path entry : stream) {
        imageFiles.add(entry);
      }

      for (int i = 0; i < imageFiles.size(); i++) {
        // Add a Page
        PDPage blankPage = new PDPage();
        doc.addPage(blankPage);
        PDPage page = doc.getPage(i);

        // Create PDImageXObject object
        PDImageXObject pdImage = PDImageXObject.createFromFile(imageFiles.get(i).toString(), doc);

        // Create the PDPageContentStream object
        PDPageContentStream contents = new PDPageContentStream(doc, page);

        // Drawing the image in the document
        contents.drawImage(pdImage, 0, 0);

        System.out.println("Image inserted");

        // Closing the PDPageContentStream object
        contents.close();
      }

      // Saving the document
      doc.save("C:/PdfBox_Examples/sample.pdf");

      // Closing the document
      doc.close();

    } catch (IOException exception) {
      throw new RuntimeException(String.format("Error converting images to PDF from directory: %s: %s",
              imageDirectory, exception.getMessage()), exception);
    }
  }
}
import org.apache.pdfbox.pdmodel.*;
import org.apache.pdfbox.pdmodel.graphics.image.*;
import java.io.IOException;
import java.nio.file.*;
import java.util.ArrayList;
import java.util.List;

public class ImageToPdf {

  public static void main(String[] args) {

    // Reference to the directory containing the images that we desire to convert
    Path imageDirectory = Paths.get("assets/images");

    // Create an empty list to contain Paths to images from the directory.
    List<Path> imageFiles = new ArrayList<>();

    PDDocument doc = new PDDocument();

    // Use a DirectoryStream to populate the list with paths for each image in the directory that we want to convert
    try (DirectoryStream<Path> stream = Files.newDirectoryStream(imageDirectory, "*.{png,jpg}")) {

      for (Path entry : stream) {
        imageFiles.add(entry);
      }

      for (int i = 0; i < imageFiles.size(); i++) {
        // Add a Page
        PDPage blankPage = new PDPage();
        doc.addPage(blankPage);
        PDPage page = doc.getPage(i);

        // Create PDImageXObject object
        PDImageXObject pdImage = PDImageXObject.createFromFile(imageFiles.get(i).toString(), doc);

        // Create the PDPageContentStream object
        PDPageContentStream contents = new PDPageContentStream(doc, page);

        // Drawing the image in the document
        contents.drawImage(pdImage, 0, 0);

        System.out.println("Image inserted");

        // Closing the PDPageContentStream object
        contents.close();
      }

      // Saving the document
      doc.save("C:/PdfBox_Examples/sample.pdf");

      // Closing the document
      doc.close();

    } catch (IOException exception) {
      throw new RuntimeException(String.format("Error converting images to PDF from directory: %s: %s",
              imageDirectory, exception.getMessage()), exception);
    }
  }
}
JAVA
A Comparison between IronPDF For Java and Apache PDF Box for Java - Figure 13: 输出 PDFBox 图像

输出 PDFBox 图像

5. 加密文档

5.1.使用 IronPDF.

在IronPDF中为PDF加密的代码如下:

import com.ironsoftware.ironpdf.*;
import java.nio.file.Paths;

// Open a document (or create a new one from HTML)
PdfDocument pdf = PdfDocument.fromFile(Paths.get("assets/composite.pdf"));

// Edit security settings
SecurityOptions securityOptions = new SecurityOptions();
securityOptions.setOwnerPassword("top-secret");
securityOptions.setUserPassword("sharable");

// Change or set the document encryption password
SecurityManager securityManager = pdf.getSecurity();
securityManager.setSecurityOptions(securityOptions);
pdf.saveAs(Paths.get("assets/secured.pdf"));
import com.ironsoftware.ironpdf.*;
import java.nio.file.Paths;

// Open a document (or create a new one from HTML)
PdfDocument pdf = PdfDocument.fromFile(Paths.get("assets/composite.pdf"));

// Edit security settings
SecurityOptions securityOptions = new SecurityOptions();
securityOptions.setOwnerPassword("top-secret");
securityOptions.setUserPassword("sharable");

// Change or set the document encryption password
SecurityManager securityManager = pdf.getSecurity();
securityManager.setSecurityOptions(securityOptions);
pdf.saveAs(Paths.get("assets/secured.pdf"));
JAVA

5.2. 使用Apache PDFBox

Apache PDFBox还提供文档加密以使文件更安全。 您还可以添加其他信息,如元数据。 代码如下

import org.apache.pdfbox.pdmodel.*;
import org.apache.pdfbox.pdmodel.encryption.*;

import java.io.File;
import java.io.IOException;

public class PDFEncryption {

  public static void main(String[] args) throws IOException {

    // Load an existing document
    File file = new File("C:/PdfBox_Examples/sample.pdf");
    PDDocument document = PDDocument.load(file);

    // Create access permission object
    AccessPermission ap = new AccessPermission();

    // Create StandardProtectionPolicy object
    StandardProtectionPolicy spp = new StandardProtectionPolicy("1234", "1234", ap);

    // Setting the length of the encryption key
    spp.setEncryptionKeyLength(128);

    // Set the access permissions
    spp.setPermissions(ap);

    // Protect the document
    document.protect(spp);

    System.out.println("Document encrypted");

    // Save the document
    document.save("C:/PdfBox_Examples/encrypted.pdf");

    // Close the document
    document.close();
  }
}
import org.apache.pdfbox.pdmodel.*;
import org.apache.pdfbox.pdmodel.encryption.*;

import java.io.File;
import java.io.IOException;

public class PDFEncryption {

  public static void main(String[] args) throws IOException {

    // Load an existing document
    File file = new File("C:/PdfBox_Examples/sample.pdf");
    PDDocument document = PDDocument.load(file);

    // Create access permission object
    AccessPermission ap = new AccessPermission();

    // Create StandardProtectionPolicy object
    StandardProtectionPolicy spp = new StandardProtectionPolicy("1234", "1234", ap);

    // Setting the length of the encryption key
    spp.setEncryptionKeyLength(128);

    // Set the access permissions
    spp.setPermissions(ap);

    // Protect the document
    document.protect(spp);

    System.out.println("Document encrypted");

    // Save the document
    document.save("C:/PdfBox_Examples/encrypted.pdf");

    // Close the document
    document.close();
  }
}
JAVA

6.定价和许可

IronPDF。 定价和许可

IronPDF可以免费用于开发简单的PDF应用程序,并可随时获得商业使用许可。IronPDF提供单个项目许可证、单个开发人员许可证、适用于代理机构和跨国公司的许可证,以及 SaaS 和 OEM 再分发许可和支持。 All licenses are available with a free trial, a 30-day money-back guarantee, and one year of software support and upgrades.

Lite 套餐的价格为 $799。 IronPDF产品绝对没有任何经常性费用。 关于软件许可的更详细信息,请参阅产品IronPDF 许可页

A Comparison between IronPDF For Java and Apache PDF Box for Java - Figure 14: IronPDF 许可

IronPDF 许可

Apache PDFBox 定价和许可

Apache PDFBox 是免费提供的,无需任何收费。 无论用于个人、内部还是商业用途,都是免费的。

您可以从Apache License 2.0 文本中包含Apache License 2.0(当前版本)。 要包含许可副本,只需在您的工作中包含它。 您还可以将以下通知作为注释附加在源代码的顶部。

Copyright [yyyy] [name of copyright owner]

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

结论

相比之下,IronPDF在功能和产品支持两方面都比Apache PDFBox更具优势。 它还提供SaaS和OEM支持,这是现代软件开发的要求。 但是,这个库不像Apache PDFBox那样免费供商业使用。

大型软件应用的公司可能需要来自第三方供应商的持续错误修复和支持,以解决在软件开发过程中出现的问题。 这是许多像Apache PDFBox这样的开源解决方案所缺乏的,这些解决方案依赖于其开发者社区的志愿支持来维持。 总之,IronPDF更适合于商业和市场使用,而Apache PDFBox更适合于个人和非商业用途。

此外还有免费试用来测试IronPDF的功能。 试一试购买 IronPDF

您现在可以在Iron Suite中以大幅折扣价获得所有Iron Software产品。访问这个Iron Suite网页以了解更多关于这个惊人交易的信息。

请注意Apache PDFBox 是其各自所有者的注册商标。 本网站与Apache PDFBox 无关联、认可或赞助。 所有产品名称、徽标和品牌均为各自所有者的财产。 比较仅供参考,反映的是撰写时的公开信息。

常见问题解答

如何在Java中将HTML转换为PDF?

您可以使用IronPDF的Java库将HTML转换为PDF。该库提供了将HTML字符串、文件或URL轻松转换为PDF的方法。

使用IronPDF for Java有哪些优势?

IronPDF for Java提供HTML到PDF转换、图像转换、自定义纸张设置以及对网站登录和自定义HTTP头的支持等功能。它设计易于使用,并提供商业支持。

IronPDF可以将图像转换为PDF吗?

是的,IronPDF可以将图像转换为PDF。此功能允许您以最小的努力从各种图像格式生成PDF文档。

Apache PDFBox的功能与IronPDF有何不同?

虽然Apache PDFBox在文本提取、表单处理和数字签名方面表现良好,但缺少直接的HTML到PDF转换。IronPDF则提供直接的HTML和URL到PDF的转换以及高级的PDF处理功能。

IronPDF适合企业使用吗?

是的,IronPDF因其商业支持、强大的功能和许可选项,使其非常适合企业使用。

将HTML转换为PDF时有哪些常见问题?

常见问题包括复杂HTML/CSS的错误渲染、缺失图像和错误的页面布局。IronPDF通过自定义纸张设置和图像支持解决了这些问题。

如何将IronPDF集成到我的Java项目中?

您可以通过从Maven下载JAR文件或将其作为依赖项添加到项目的pom.xml文件中,将IronPDF集成到Java项目中。

Apache PDFBox的用途是什么?

Apache PDFBox用于创建、编辑和操纵PDF文档。支持文本提取、文档拆分和合并、表单填写和数字签名。

IronPDF是否有相关的许可费用?

IronPDF提供免费试用和基本开发免费,但商业用途需要许可证。提供多种许可选项以满足不同需求。

为什么有人会选择Apache PDFBox而不是IronPDF?

如果需要用于个人或非商业使用的免费开源解决方案且不需要HTML到PDF转换,可能会选择Apache PDFBox而不是IronPDF。

Darrius Serrant
全栈软件工程师(WebOps)

Darrius Serrant 拥有迈阿密大学的计算机科学学士学位,目前在 Iron Software 担任全栈 WebOps 市场工程师。从小就被编码吸引,他认为计算机既神秘又易于接触,使其成为创意和问题解决的理想媒介。

在 Iron Software,Darrius 喜欢创造新事物,并简化复杂概念以使其更易理解。作为我们常驻的开发者之一,他还自愿教授学生,与下一代分享他的专业知识。

对于 Darrius 来说,他的工作令人满意,因为它被重视并产生真正的影响。