I'm not quite sure how to provide you something you can actually use. The relevant code is basically identical (and indeed lifted from) the CExAPI sample. I have a wrapper class APDFX9 with a PreparePrinter routine ...
Code: Select all
BOOL APDFX9::PreparePrinter(PXC::IPXCPrinterPtr& printer, PXC::IPXCControlExPtr& pFactory, BOOL bNoEvents)
{
if (printer == NULL)
{
printer = pFactory->Printer[(WCHAR*)L"", m_wchPrinterName, m_pKey, m_pDevCode];
if (printer == NULL)
return FALSE;
if (!bNoEvents)
DispEventAdvise(printer);
}
printer->ResetDefaults();
...
printer->Option[L"Paper.SheetSizeIndex"] = L"1";
printer->ApplyOptions(0);
I haven't gone through all of the possible printer options, but others that I've tried clearly work, such as Save.Path. And the code all worked in version 5, with the main update being to use the new pdfsaver.tlb that came with the V9 API.
Perhaps I can build a small one based on the CExAPI sample. But oddly, I can't get that sample program to work. It seems to be targeted at API V7, and fails on the init ...
Code: Select all
m_pFactory = PXC::IPXCControlExPtr(__uuidof(PXC::CPXCControlEx));
The pre-compiled versions also appear to have a similar problem (and do nothing when clicking Go).
Is there an updated sample specifically targeted at V9?