Sub AppStart (Args() As String)
Log("PDFBox")
Me.as(JavaObject).RunMethod("mulFile2One", Null)
End Sub
#if java
import org.apache.pdfbox.io.IOUtils;
import org.apache.pdfbox.multipdf.PDFMergerUtility;
import org.apache.pdfbox.io.RandomAccessStreamCache;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
public static void mulFile2One() throws IOException{
PDFMergerUtility mergePdf = new PDFMergerUtility();
mergePdf.addSource(new File("D:\\test\\f1.pdf"));
mergePdf.addSource(new File("D:\\test\\f2.pdf"));
mergePdf.setDestinationFileName("D:\\test\\mul2one.pdf");
RandomAccessStreamCache.StreamCacheCreateFunction streamCache
= IOUtils.createMemoryOnlyStreamCache();
mergePdf.mergeDocuments(streamCache);
}
#End If