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

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 26.08.2009, 17:05   #1  
Blog bot is offline
Blog bot
Участник
 
25,475 / 846 (79) +++++++
Регистрация: 28.10.2006
palleagermark: Print images directly to a printer with ShellExecute (in XP)
Источник: http://palleagermark.blogspot.com/20...nter-with.html
==============

If you need to write code in AX to print an image file directly to a printer, your first thought might be to call shellExecute like this:


winapi::shellExecute(filename.jpg, '', '', 'print');


This would be fine with other types of files, but in XP image files will be printed via the Photo Printing Wizard, so in this case you simply don't get the file printed.


If you open Tools / Folder Options from an Explorer, go to the tab page File Types and find the type of image you want to print, you can click Advanced button to see that the operating system does when you right click on a file of that type and select print. If available the information will be under "printto". For TIF images on my box, I can see that this is what it will call:


rundll32.exe C:\WINDOWS\system32\shimgvw.dll,ImageView_PrintTo /pt "%1" "%2" "%3" "%4"


So in reality this is what you have to call through shellExecute.


Here is a sample job for that:

static void TestPrint(Args _args)
{
;
winapi::shellExecute(@'C:\WINDOWS\System32\rundll32.exe', @'C:\WINDOWS\System32\shimgvw.dll,ImageView_PrintTo /pt "C:\MYIMAGEFILE.TIF" "\\PRINTSERVER\PRINTERNAME" "%3" "%4"');
}


Источник: http://palleagermark.blogspot.com/20...nter-with.html
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
Microsoft Dynamics AX 2009 White Paper: Print Management Integration Guide Vadik DAX: База знаний и проекты 5 06.05.2009 13:59
Images on Form and Thumbnails in Grid Blog bot DAX Blogs 0 22.10.2008 09:05
casperkamal: Adding custom images for Treenode in Dynamics Ax Blog bot DAX Blogs 0 25.07.2008 03:08
Спасем Windows XP! belugin Курилка 25 15.04.2008 14:17
The X++ Print Statement (by Sharon E. Cannon) Maxim Gorbunov DAX in English 2 06.04.2006 20:11
Опции темы Поиск в этой теме
Поиск в этой теме:

Расширенный поиск
Опции просмотра

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

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

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 07:43.
Powered by vBulletin® v3.8.5. Перевод: zCarot
Контактная информация, Реклама.