AXForum  
Вернуться   AXForum > Microsoft Dynamics AX > DAX Blogs
All
Забыли пароль?
Зарегистрироваться Правила Справка Пользователи Сообщения за день Поиск

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 28.05.2015, 14:12   #1  
Blog bot is offline
Blog bot
Участник
 
25,644 / 848 (80) +++++++
Регистрация: 28.10.2006
palleagermark: Open and close PDF reader from code
Источник: http://www.agermark.com/2015/05/open...from-code.html
==============

Here is an example of how you can open Adobe PDF Reader (or another PDF reader) with a particular PDF document, and close the reader again.
static void pager_FindWindow(Args _args)
{
Filename pdfFileName = 'MyDocumentFile.pdf';
FilePath pdfFilePath = @'C:\XYZ\';
str adobeExe;

System.Diagnostics.Process process;
System.Diagnostics.ProcessStartInfo processStartInfo;

// Let Windows figure out the standard program and location for the PDF reader
adobeExe = WinAPI::findExecutable(pdfFilePath + pdfFileName);

// Start the reader process
new InteropPermission(InteropKind::ClrInterop).assert();

process = new System.Diagnostics.Process();

processStartInfo = new System.Diagnostics.ProcessStartInfo();
processStartInfo.set_FileName(adobeExe);
processStartInfo.set_Arguments(pdfFilePath + pdfFileName);

process.set_StartInfo(processStartInfo);

process.Start();


// Wait 5 secs. before closing the window
sleep (5000);

// Close the window
process.Kill();
}

Источник: http://www.agermark.com/2015/05/open...from-code.html
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
palleagermark: How to delete Label Files from AX 2012 Blog bot DAX Blogs 0 22.01.2014 15:11
atinkerersnotebook: Using Service Management to Track Service Orders Blog bot DAX Blogs 1 25.08.2013 19:16
dynamicsaxtraining: Vendor returns Blog bot DAX Blogs 0 11.10.2012 00:11
CRM DE LA CREME! Some more useful javascripts for MS CRM Blog bot Dynamics CRM: Blogs 0 04.05.2010 11:05
Вопрос про Demand Planner slava09 DAX: Функционал 4 25.09.2006 11:43

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 00:18.