humanemulator.net — справка.
Продукт, демо и покупка — на
хуманэмулятор.рф
|
Демо
|
Купить
|
API
|
Changelog
remove_info
remove_info($inpath,$outpath,$info="PersonalInformation",$timeout=3000); - Удалить значение свойства документа из WORD файла и записать обновленный файл по указанному путиварианты значений для $info: 'comments', 'revisions', 'versions', 'personalinformation', 'emailheader' и т.д. см. документацию
Функция на вход принимает параметры:
После выполнения функции возвращаемое значение будет равно одному из двух :
Пример использования
<?php // Scenario: Remove personal information from a Word document $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"; // Kill any existing Word app processes $result = SYSTEM::$word->kill(); if ($result) { echo("Successfully kill Word app process\n"); } else { echo("Failed to kill Word app process\n"); } // Define file paths in Linux format $inputPath = "test/test.docx"; $outputPath = "test/test_ri.docx"; // Open the file for edit SYSTEM::$word->open($inputPath, false); // Example 1: Remove personal information from Word document and save with new name echo("1. Remove personal information from Word document and save with new name: "); $removeInfoResult = SYSTEM::$word->remove_info($inputPath, $outputPath); if ($removeInfoResult) echo("true\n"); else echo("false\n"); // Save and close the document SYSTEM::$word->save($inputPath); SYSTEM::$word->close($inputPath); echo "\n"; // Quit the application WINDOW::$app->quit(); ?>
# Additional paths import sys sys.path.insert(0, '../../../Templates PY/') xhe_host = "127.0.0.1:7027" from xweb_human_emulator import * # начало echo("<hr><font color=blue>sound.xxxxxxxxx</font><hr>") inpath = "test\\test.docx"; outpath = "test\\test_ri.docx"; # 1 echo("1. Удалим персональную информацию из word файла и запишем его под новым именем : "); echo(word.remove_info(inpath,outpath)); app.shell_execute("open",outpath); # конец echo("<hr><br>") # 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>word.close</font><hr>"); var inpath = "test\\test.docx"; var outpath = "test\\test_ri.docx"; // 1 echo("1. Удалим персональную информацию из word файла и запишем его под новым именем : "); echo(word.remove_info(inpath,outpath)); app.shell_execute("open",outpath); // конец echo("\n\n"); app.quit(); } }
// подключим функциональные объекты, если еще не подключен xhe_host="127.0.0.1:7027"; echo=require("../../../Templates JS/init.js"); // начало echo("<hr><font color=blue>sound.beep</font><hr>"); inpath = "test\\test.docx"; outpath = "test\\test_ri.docx"; // 1 echo("1. Удалим персональную информацию из word файла и запишем его под новым именем : "); echo(word.remove_info(inpath,outpath)); app.shell_execute("open",outpath); // конец echo("\n"); // Quit app.quit();
=============================================
word Объекты DOM System Vision Web Window
=============================================
если что-то непонятно или необходимо узнать или считаете что надо добавить по работе этой функции, пишите в комментарии или на наш форум
.