Edit C:\Program Files\PDFCreator\COM Scripts\JS Scripts\Basics\TestPageMergeTarget.js
// TestPageMergeTarget.js script // Part of PDFCreator // License: GPL // Homepage: http://www.pdfforge.org/pdfcreator // Windows Scripting Host version: 5.6 // Version: 1.0.0.0 // Date: July, 28. 2014 // Author: Sazan Hoti // Comments: This script demonstrates the merge of own files and then converts all // files in the queue to pdf-files. This includes converting multiple files sequentially. var objFSO = new ActiveXObject("Scripting.FileSystemObject"); var objShell = new ActiveXObject("Shell.Application"); var Scriptname = objFSO.GetFileName(WScript.ScriptFullname); if (WScript.Version < 5.6) { WScript.Echo("You need the \"Windows Scripting Host version 5.6\" or greater!"); WScript.Quit(); } try { var PDFCreatorQueue = new ActiveXObject("PDFCreatorBeta.JobQueue"); WScript.Echo("Initializing PDFCreator queue..."); PDFCreatorQueue.Initialize(); var fullPath = objFSO.GetParentFolderName(WScript.ScriptFullname) + "\\TestPage.pdf"; WScript.Echo("Setting up target path to: " + fullPath); WScript.Echo("Printing 4 times the windows test page..."); objShell.ShellExecute("RUNDLL32.exe", "PRINTUI.DLL,PrintUIEntry /k /n \"PDFCreator\"", "", "open", 1); objShell.ShellExecute("RUNDLL32.exe", "PRINTUI.DLL,PrintUIEntry /k /n \"PDFCreator\"", "", "open", 1); objShell.ShellExecute("RUNDLL32.exe", "PRINTUI.DLL,PrintUIEntry /k /n \"PDFCreator\"", "", "open", 1); objShell.ShellExecute("RUNDLL32.exe", "PRINTUI.DLL,PrintUIEntry /k /n \"PDFCreator\"", "", "open", 1); WScript.Echo("Waiting for 4 jobs to arrive at the queue for " + 10 + " seconds"); if(!PDFCreatorQueue.WaitForJobs(4, 10)) { WScript.Echo("The print job did not reach the queue within " + 10 + " seconds"); } else { WScript.Echo("Currently there are " + PDFCreatorQueue.Count + " job(s) in the queue"); WScript.Echo("Merging second and third job"); //Hint: Queue starts job counting with 0! PDFCreatorQueue.MergeJobs(PDFCreatorQueue.GetJobByIndex(1), PDFCreatorQueue.GetJobByIndex(2)); WScript.Echo("Starting conversion process for all jobs in the queue sequentially"); //while loop for converting sequentially while(PDFCreatorQueue.Count > 0) { WScript.Echo("Getting next available job instance"); var job = PDFCreatorQueue.NextJob; job.SetProfileByGuid("DefaultGuid"); WScript.Echo("Converting under \"DefaultGuid\" conversion profile"); job.ConvertTo(fullPath); if(!job.IsFinished || !job.IsSuccessful) { WScript.Echo("Could not convert the file: " + fullPath); } else { WScript.Echo("Job finished successfully"); } } } WScript.Echo("Releasing the object"); PDFCreatorQueue.ReleaseCom(); } catch(e) { WScript.Echo(e.message); PDFCreatorQueue.ReleaseCom(); }
Ms-Dos/Windows
Unix
Write backup
jsp File Browser version 1.2 by
www.vonloesch.de