humanemulator.net — справка.
Продукт, демо и покупка — на
хуманэмулятор.рф
|
Демо
|
Купить
|
API
|
Changelog
export_all_pages
export_all_pages($inpath,$to_folder,$ext="pdf",$filters="",$is_match_all=false,$timeout=3000); - Экспортировать каждую страницу WORD документа в отдельный файл в формате PDF или XPSвариант конвертации определяется по значению аргумента $ext.
Функция на вход принимает параметры:
После выполнения функции возвращаемое значение будет равно одному из двух :
Пример использования
<?php // Scenario: Export all pages of a Word document to PDF files $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 $sourceFilePath = "test/test.docx"; $outputFolder = "pdfs"; $outputFormat = "pdf"; $searchTextArray = array("12345", "678"); $exactMatch = true; // Example 1: Export all pages to PDF echo("1. Export all pages to PDF: "); $result = SYSTEM::$word->export_all_pages($sourceFilePath, $outputFolder); if ($result) { echo("Successfully exported all pages\n"); } else { echo("Failed to export all pages\n"); } // Clear the output folder SYSTEM::$folder->clear($outputFolder); // Example 2: Export all pages with specified text to PDF echo("\n2. Export all pages with specified text to PDF: "); $result = SYSTEM::$word->export_all_pages($sourceFilePath, $outputFolder, $outputFormat, $searchTextArray, $exactMatch); if ($result) { echo("Successfully exported pages with specified text\n"); } else { echo("Failed to export pages with specified text\n"); } echo "\n"; // Quit the application WINDOW::$app->quit(); ?>
# Additional paths import sys sys.path.insert(0, '../../../Templates PY/') xhe_host = "127.0.0.1:7012" from xweb_human_emulator import * # начало echo("<hr><font color=blue>sound.xxxxxxxxx</font><hr>") # 1 echo("1. Экспортировать все страницы в pdf : "); echo(word.export_all_pages("test\\test.docx","test\\test_pdf")); app.shell_execute("open","test\\test_pdf") # конец 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>pdffile.get_page_count</font><hr>"); // 1 echo("1. Экспортировать все страницы в pdf : "); echo(word.export_all_pages("test\\test.docx","test/pdf")); app.shell_execute("open","test/pdf"); // конец 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. Экспортировать все страницы в pdf : "); echo(word.export_all_pages("test\\test.docx","test\\pdf")); app.shell_execute("open","test\\pdf"); // конец echo("\n"); // Quit app.quit();
=============================================
word Объекты DOM System Vision Web Window
=============================================
если что-то непонятно или необходимо узнать или считаете что надо добавить по работе этой функции, пишите в комментарии или на наш форум
.