<?php // Copyright (c) 2021 ActivePDF, Inc. // ActivePDF Meridian 2010 // Example generated 03/05/21 ?> <?php // Get current path $strPath = dirname(__FILE__) . "\\"; // Instantiate Object $oMER = new COM("APMeridian.Object"); // Specify the IP address and Port to use to reach the Meridian Server $oMER->StartRemoteClient("192.168.1.100", 58585); // Must use either SetUniuqeInput or SetProcessAndThread // Call SetUniqueInput with the full path to the input // it is best to use a unique filename to avoid potential // name collisions, if the filename is unique set the second // parameter to true $oMER->SetUniqueInput($strPath . "Word.doc", true); // Here we are using SetUniqueInput, as the print job is // from Microsoft Word, Word will add 'Microsoft Word - ' // to the print job so we need to let meridian know using // UniqueInputPrefix $oMER->UniqueInputPrefix = "Microsoft Word - "; // Path and filename of the created PDF $oMER->OutputDirectory = $strPath; $oMER->NewDocumentName = "Word.pdf"; // Set the ModelPrinter to the remote Meridian printer // This printer must be added locally to the remote system $oMER->ModelPrinter = "\\192.168.1.100\Meridian"; // Prepare to start the printing process $intStartPrinting = $oMER->StartPrinting(); if ($intStartPrinting != 0) { Error("StartPrinting", $intStartPrinting); } // Automate Word to print a document to Meridian // End the printing process $oMER->StopPrinting(); // Wait(seconds) for job to complete $intWait = $oMER->Wait(30); if ($intWait != 0) { Error("Wait", $intWait); } // Release Object $oMER = null; // Process Complete echo "Done!"; // Error Handling function Error($method, $outputCode) { echo "Error in " . $method . ": " . $outputCode; } ?>