pdfa4改成a3_如何将现有A4 PDF文档转换为A3小册子?

本文介绍了如何在Java中利用iText库将现有的A4大小PDF转换为A3格式的小册子。通过创建一个设置为A3旋转的Document对象,然后遍历PDF页面,偶数页添加到A3页面的一侧,奇数页添加到另一侧,最终生成一个150页的A3小册子。
摘要由CSDN通过智能技术生成

Hi We have a requirement to convert an existing A4 size pdf to A3 Size PDF in java. Since i am new to itext api conversion pdfs, Can anyone guide me how to do in java using itext or any other api to do. If sample reference provided then appreciable.

UPDATe: Output PDF should be in A3 booklet format.

解决方案

Please take a look at the MakeA3Booklet example.

In this example, we take an existing PDF document with 299 A4 pages (primes.pdf) and we convert it to a 150-page A3 booklet (a3_booklet.pdf):

public void manipulatePdf(String src, String dest)

throws IOException, DocumentException {

// Creating a reader

PdfReader reader = new PdfReader(src);

// step 1

Document document = new Document(PageSize.A3.rotate());

// step 2

PdfWriter writer

= PdfWriter.getInstance(document, new Fil

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值