get_info(path, name); - получить информацию с заданным атрибутом
Функция на вход принимает параметры:
path – путь к pdf файлу name – имя атрибута который надо получить, например: и так далее.
- "title" - заголовок
- "subject" - тема
- "author" - автор
- "producer" - продюсер
- "creator" - создатель
- "creation_date" - дата создания
- "modification_date" - дата изменения
- "keywords" - ключевые слова
- "pages" - страницы
- "count" - число атрибутов
- "is_readonly" - только для чтения
После отработки функция возвращает результат своей работы в робот :
информация – информация, по заданному атрибуту (string)
Пример использования get_info (Python):
# Additional paths import sys sys.path.insert(0, '../../../Templates PY/') xhe_host = "127.0.0.1:7013" from xweb_human_emulator import * # начало echo("<hr><font color=blue>sound.xxxxxxxxx</font><hr>") # 1 echo("\n1. Получим заголовок : "); echo(pdffile.get_info("test\\test.pdf","title")); # 2 echo("\n2. Получим тему : "); echo(pdffile.get_info("test\\test.pdf","subject")); # 3 echo("\n\n3. Получим author : "); echo(pdffile.get_info("test\\test.pdf","author")); # 4 echo("\n4. Получим producer : "); echo(pdffile.get_info("test\\test.pdf","producer")); # 5 echo("\n5. Получим creator : "); echo(pdffile.get_info("test\\test.pdf","creator")); # 6 echo("\n\n6. Получим creation_date : "); echo(pdffile.get_info("test\\test.pdf","creation_date")); # 7 echo("\n7. Получим modification_date : "); echo(pdffile.get_info("test\\test.pdf","modification_date")); # 8 echo("\n\n8. Получим keywords : "); echo(pdffile.get_info("test\\test.pdf","keywords")); # 9 echo("\n9. Получим pages : "); echo(pdffile.get_info("test\\test.pdf","pages")); # 10 echo("\n10. Получим число добавочных ключей с информацией : "); echo(pdffile.get_info("test\\test.pdf","count")); # 11 echo("\n11. Получим is_readonly : "); echo(pdffile.get_info("test\\test.pdf","is_readonly")); # конец echo("<hr><br>") # Quit app.quit()
Пример использования get_info (JS):
// подключим объект для управления эмулятором, если еще не подключен xhe_host="127.0.0.1:7013"; echo=require("../../../Templates JS/init.js"); // начало echo("<hr><font color=blue>sound.beep</font><hr>"); // 1 шаг echo("1. Пикнуть : "); echo(sound.beep()); // 1 echo("\n1. Получим заголовок : "); echo(pdffile.get_info("test\\test.pdf","title")); // 2 echo("\n2. Получим тему : "); echo(pdffile.get_info("test\\test.pdf","subject")); // 3 echo("\n\n3. Получим author : "); echo(pdffile.get_info("test\\test.pdf","author")); // 4 echo("\n4. Получим producer : "); echo(pdffile.get_info("test\\test.pdf","producer")); // 5 echo("\n5. Получим creator : "); echo(pdffile.get_info("test\\test.pdf","creator")); // 6 echo("\n\n6. Получим creation_date : "); echo(pdffile.get_info("test\\test.pdf","creation_date")); // 7 echo("\n7. Получим modification_date : "); echo(pdffile.get_info("test\\test.pdf","modification_date")); // 8 echo("\n\n8. Получим keywords : "); echo(pdffile.get_info("test\\test.pdf","keywords")); // 9 echo("\n9. Получим pages : "); echo(pdffile.get_info("test\\test.pdf","pages")); // 10 echo("\n10. Получим число добавочных ключей с информацией : "); echo(pdffile.get_info("test\\test.pdf","count")); // 11 echo("\n11. Получим is_readonly : "); echo(pdffile.get_info("test\\test.pdf","is_readonly")); // конец echo("<hr><br>"); // Quit app.quit();