2

在这里,我想将两个单独的 A4 PDF 合并到 A3 PDF。A4 PDF 页面应该适合并排查看的 A3 2-ups。

我现在还没有尝试任何代码,但在我想知道这可能吗?

注意:A4 PDF 可以有“N”页而不是单页 PDF。

这是图形图像示例:

在此处输入图像描述

4

2 回答 2

1

您可以将两个 PDF 文档连接成一个包含所有 A4 尺寸页面的 PDF 文档。然后您可以使用MakeNUp按类公开的方法PdfFileEditor,以便在 A3 大小的输出文档上获得 1 行和 2 列。下面的代码片段是建议方法的基本实现:

// Open first document
Document pdfDocument1 = new Document(dataDir + "PDF1.pdf");
// Open second document
Document pdfDocument2 = new Document(dataDir + "PDF2.pdf");
// Add pages of second document to the first OR vice versa
pdfDocument1.Pages.Add(pdfDocument2.Pages);
// Save concatenated output file
pdfDocument1.Save(dataDir + "Concatenate.pdf");

//Final step of organizing pages as per your requirements
PdfFileEditor editor = new PdfFileEditor();
editor.MakeNUp(dataDir + "Concatenate.pdf", dataDir + "output.pdf", 2, 1 , PageSize.A3);

有关更多详细信息和信息,您可以访问以下链接:

PS:我与 Aspose 一起担任开发人员宣传员。

于 2019-01-31T21:20:08.773 回答
1

这些官方 iText 示例中很好地解释了如何实现它:

iText7 https://github.com/itext/i7js-examples/blob/develop/src/test/java/com/itextpdf/samples/sandbox/merge/MakeBookletA3.java

iText5 https://github.com/itext/i5js-sandbox/blob/master/src/main/java/sandbox/merge/MakeBookletA3.java

代码是用 Java 编写的,但是将示例移植到 C# 应该没有问题,因为 API 完全一样。

于 2019-01-31T13:35:05.720 回答