Reply to Re: PDF printing under windows.

Your name:

Reply:


Posted by "Dan Baker" on 10/24/05 23:39

"Dave Lists" <dave.lists@gmail.com> wrote in message
news:435D2C8C.4090709@gmail.com...
> I'm generating PDFs under windows using PDFlib and all is easy. What I am
> wondering though, and google reveals nothing usefull, can I print the PDF
> to a network printer from windows? I'm presuming to print the file I would
> ahve to use COM and open it under Acrobat? Anyone done this before and
> have any pointers? I'm printing out invoices and what to automate the
> task.

I print PDF files using the following code (which prints them to the default
printer):
SHELLEXECUTEINFO sei;
ZeroMemory(&sei, sizeof(SHELLEXECUTEINFO));
sei.cbSize = sizeof(SHELLEXECUTEINFO);
sei.fMask = SEE_MASK_FLAG_NO_UI | SEE_MASK_NOCLOSEPROCESS;
sei.lpVerb = _T("print");
sei.lpFile = pFile; // -> complete path to file to print
sei.hwnd = CDLBUtils::g_Data.m_hWnd;
sei.nShow = SW_HIDE;
if (ShellExecuteEx(&sei) && sei.hInstApp > (HINSTANCE)32) {
// ok
} else {
// failed
}

Note1: You can change the default printer before calling this.
Note2: Acrobat will launch, and may stay running even after the printing
process has finished

DanB

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация