用Java用PDF添加和删除图层

PDF layers allow users to selectively hide or show the content appearing on them in PDF documents. In this article, we will introduce how to add layers to a PDF document, draw content to the layers and delete a specific layer in Java using Free Spire.PDF for Java library.

Before getting started, please download Free Spire.PDF for Java package through this link, unzip the package and then import Spire.Pdf.jar from lib folder into our application.

Add layers to a PDF

在下面的示例中,我们将学习如何在PDF文档中添加两层,以及如何将PDF页面的内容和图像绘制到这些层。

import com.spire.pdf.PdfDocument;
import com.spire.pdf.PdfPageBase;
import com.spire.pdf.graphics.*;
import com.spire.pdf.PdfPageSize;
import com.spire.pdf.graphics.layer.PdfLayer;

import java.awt.*;
import java.awt.geom.Point2D;

public class AddLayers 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值