humanemulator.net — справка.
Продукт, демо и покупка — на
хуманэмулятор.рф
|
Демо
|
Купить
|
API
|
Changelog
compare
compare($inpath1,$inpath2,$timeout=3000); - Сравнить 2 WORD документав результате операции будет создано 2 файла. Путь к первому файлу, как у первого файла + '.compared.docx'. И путь к первому файлу, как у первого файла + '.compared.csv'
Функция на вход принимает параметры:
После выполнения функции возвращаемое значение будет равно одному из двух :
Пример использования
<?php // Scenario: Compare two Word documents $xhe_host = getenv("RPABOT_HOST_URL"); // Connect functional objects if not already connected if (!isset($path)){ $path = "../../../Templates/init.php"; require($path); } // info echo "\n<span >word->" . basename (__FILE__) . "</span>\n"; // Initialize variables $firstFilePath = "test/test.docx"; $secondFilePath = "test/converted/converted.docx"; // Kill any existing Word processes SYSTEM::$word->kill(); // Example 1: Compare two Word documents echo("1. Compare two Word documents: "); $result = SYSTEM::$word->compare($firstFilePath, $secondFilePath); if ($result) { echo("Successfully compared documents\n"); } else { echo("Failed to compare documents\n"); } // Close the documents SYSTEM::$word->close($firstFilePath); SYSTEM::$word->close($secondFilePath); echo "\n"; // Quit the application WINDOW::$app->quit(); ?>
# Additional paths import sys sys.path.insert(0, '../../../Templates PY/') xhe_host = "127.0.0.1:7036" from xweb_human_emulator import * # 1 echo("1.Сравнить 2 файла : "); echo(wordfile.compare("test\\test.docx","test\\converted.docx")); app.shell_execute("open","test\\test.docx.compared.csv"); app.shell_execute("open","test\\test.docx.compared.docx"); # покажем результаты app.shell_execute("","test\\test.pdf"); # Quit app.quit()
#region using using System; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.IO; using System.Text; using System.Threading; using XHE; using XHE.XHE_DOM; using XHE.XHE_System; using XHE.XHE_Window; using XHE.XHE_Web; #endregion class Program:XHEScript { static void Main(string[] args) { // init XHE server = Environment.GetEnvironmentVariable("RPABOT_HOST_URL"); InitXHE(); // начало echo("<hr><font color=blue>pdffile.write</font><hr>"); // 1 echo("1.Сравнить 2 файла : "); echo(word.compare("test\\test.docx","test\\converted\\converted.docx")); app.shell_execute("open","test\\test.docx.compared.csv"); app.shell_execute("open","test\\test.docx.compared.docx"); // конец echo("\n\n"); app.quit(); } }
// подключим функциональные объекты, если еще не подключен xhe_host="127.0.0.1:7012"; echo=require("../../../Templates JS/init.js"); // начало echo("<hr><font color=blue>sound.beep</font><hr>"); // 1 echo("1.Сравнить 2 файла : "); echo(word.compare("test\\test.docx","test\\converted\\converted.docx")); app.shell_execute("open","test\\test.docx.compared.csv"); app.shell_execute("open","test\\test.docx.compared.docx"); // конец echo("\n"); // Quit app.quit();
=============================================
word Объекты DOM System Vision Web Window
=============================================
если что-то непонятно или необходимо узнать или считаете что надо добавить по работе этой функции, пишите в комментарии или на наш форум
.