Merge PDF Documents | VBScriptByteScout PDF Extractor SDK

Merge PDF Documents | VBScript

MergeDocuments.vbs:

VB
' Create Bytescout.PDFExtractor.DocumentMerger object
Set merger = CreateObject("Bytescout.PDFExtractor.DocumentMerger")
merger.RegistrationName = "demo"
merger.RegistrationKey = "demo"

merger.Merge2 "sample1.pdf", "sample2.pdf", "result.pdf"

Set merger = Nothing

WScript.Echo "Merged document saved as 'result.pdf'."

MergeDocuments.js:

JavaScript
var merger = new ActiveXObject("Bytescout.PDFExtractor.DocumentMerger");
merger.RegistrationName = "demo";
merger.RegistrationKey = "demo";

var comHelpers = new ActiveXObject("Bytescout.PDFExtractor.ComHelpers");

var aFiles = ['.. \ .. \ sample1.pdf', '.. \ .. \ sample2.pdf'];
var compArray = comHelpers.CreateCompatibleArray(aFiles);

filename = 'output.pdf';
merger.Merge(compArray, filename);
merger = null;