package com.zzbest.tools.worddata;

import java.io.IOException;

import org.apache.pdfbox.pdmodel.PDDocument;
import org.apache.pdfbox.pdmodel.PDPage;
import org.apache.pdfbox.pdmodel.PDPageContentStream;
import org.apache.pdfbox.pdmodel.font.PDFont;
import org.apache.pdfbox.pdmodel.font.PDType1Font;

public class PDFMergeUtil {

	public static final String file1 = "C:\\Temp\\PDF(1).pdf";
	public static final String file2 = "C:\\Temp\\PDF(2).pdf";

	public static void main(String[] args) throws IOException {
		PDDocument document = new PDDocument();
		PDPage page = new PDPage();
		document.addPage(page);

		PDFont font = PDType1Font.HELVETICA_BOLD;

		PDPageContentStream contentStream = new PDPageContentStream(document, page);

		String message = "Hello.World------";
		contentStream.beginText();
		contentStream.setFont(font, 12);
		contentStream.newLineAtOffset(100, 700);
		for (int i = 0; i < 10000; i++) {
			contentStream.showText(message + " " + Integer.toString(i));
			System.out.println(message + " " + Integer.toString(i));
			contentStream.newLineAtOffset(0, -15); // (x,y)坐标，当前鼠标的位置为(0.0) -15
													// 表示鼠标沿Y方向（向下）移动15
		}
		contentStream.endText();

		contentStream.close();

		document.save("c:\\Temp\\Hello World.pdf");
		document.close();
	}

}

@@ -198,16 +198,69 @@
 Stream;%0A
+import org.apache.pdfbox.pdmodel.common.PDRectangle;%0A
 import o
@@ -347,16 +347,180 @@
 pe1Font;
+%0Aimport org.apache.pdfbox.pdmodel.interactive.action.PDActionGoTo;%0Aimport org.apache.pdfbox.pdmodel.interactive.documentnavigation.destination.PDPageXYZDestination;
 %0A%0Apublic
@@ -793,18 +793,56 @@
  PDPage(
-);
+PDRectangle.A4);// %E8%AE%BE%E7%BD%AE%E9%A1%B5%E9%9D%A2%E5%A4%A7%E5%B0%8F,%E5%9D%90%E6%A0%87(0,0)%E7%9A%84%E4%BD%8D%E7%BD%AE%E5%9C%A8%E5%B7%A6%E4%B8%8B%E8%A7%92
 %0A%09%09docum
@@ -1126,14 +1126,12 @@
 set(
-10
 0, 
-7
+8
 00);
@@ -1453,16 +1453,336 @@
 ose();%0A%0A
+%09%09// %E8%AE%BE%E7%BD%AE%E7%BC%A9%E6%94%BE%E6%AF%94%E4%BE%8B:100%25 75%25 %E7%AD%89%E7%AD%89%0A%09%09PDPageXYZDestination dest = new PDPageXYZDestination();%0A%09%09dest.setPage(page);%0A%09%09dest.setZoom(1f);%0A%09%09dest.setTop(new Float(PDRectangle.A4.getHeight()).intValue());%0A%09%09PDActionGoTo action = new PDActionGoTo();%0A%09%09action.setDestination(dest);%0A%09%09document.getDocumentCatalog().setOpenAction(action);%0A%0A
 %09%09docume

Update PDFCreateNewLine.java