Upgrading from V3 to V4

PDF-XChange Drivers API (only) V4/V5
This Forum is for the use of Software Developers requiring help and assistance for Tracker Software's PDF-XChange Printer Drivers SDK (only) - VERSION 4 & 5 - Please use the PDF-Tools SDK Forum for Library DLL assistance.

Moderators: TrackerSupp-Daniel, Tracker Support, Vasyl-Tracker Dev Team, Sean - Tracker, Chris - Tracker Supp, Tracker Supp-Stefan

Post Reply
gfindlay
User
Posts: 12
Joined: Tue Oct 19, 2004 5:08 pm

Upgrading from V3 to V4

Post by gfindlay » Thu Aug 11, 2011 10:08 pm

I'm contemplating upgrading from V3 to V4.

I can't find a good document on how to go about doing this. We simply have our C++ code set the default printer to be the PDF-XChange 3.0 driver, set the key to hide the watermarks, and let the normal flow of printing create the PDF file.

In V3, we used code like this:

static DWORD m_WM_PDFDOC_START = ::RegisterWindowMessage(_T("PDFXC3_StartDoc"));

At the start of each new document:
LRESULT CMainFrame::OnPDFDocStart(WPARAM wParam, LPARAM lParam)
{
if (!m_pApp->m_bPDFHook)
return 0;
m_pApp->m_bPDFHook = FALSE;

DWORD dRes, dDesired;
CString sKeyname;
CString sKey(_T("[our key]"));
CString sDevCode(_T("[our coode]"));
CString sCreator;
sCreator.LoadString(IDS_WPPRINTERNAME);

sKeyname.Format(_T("Software\\Tracker Software\\PDF-XChange 3.0\\Drivers\\Control\\%.8lx"), lParam);
HKEY hKey;
dRes = RegCreateKeyEx(HKEY_CURRENT_USER, sKeyname, 0, NULL, 0, KEY_WRITE, NULL, &hKey, &dDesired);
if (dRes != ERROR_SUCCESS)
return 0;

CString sApp(_T("Default"));
CString sTitle(_T("A Title"));
CString sAuthor;
sAuthor = _T("Author");
CString s(_T("Name"));
RegSetValueEx(hKey, _T("Reg.Key"), 0, REG_SZ, (BYTE *)(LPCTSTR )sKey, (sKey.GetLength() + 1) * sizeof(TCHAR));
RegSetValueEx(hKey, _T("Reg.DevCode"), 0, REG_SZ, (BYTE *)(LPCTSTR )sDevCode, (sDevCode.GetLength() + 1) * sizeof(TCHAR));
RegSetValueEx(hKey, _T("Info.Title"), 0, REG_SZ, (BYTE *)(LPCTSTR )sTitle, (sTitle.GetLength() + 1) * sizeof(TCHAR));
RegSetValueEx(hKey, _T("Info.Author"), 0, REG_SZ, (BYTE *)(LPCTSTR )sAuthor, (sAuthor.GetLength() + 1) * sizeof(TCHAR));
RegSetValueEx(hKey, _T("Info.Creator"), 0, REG_SZ, (BYTE *)(LPCTSTR )sCreator, (sCreator.GetLength() + 1) * sizeof(TCHAR));
// RegSetValueEx(hKey, _T("RunApp"), 0, REG_SZ, (BYTE*)(LPCTSTR )sApp, (sApp.GetLength() + 1) * sizeof(TCHAR));
RegCloseKey(hKey);

return 1;
}


Once the document was complete, PDF Exchange 3.0 asked the user for a filename, then saved it.

What do we do to accomplish the same in V4?

User avatar
Tracker Supp-Stefan
Site Admin
Posts: 14154
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Upgrading from V3 to V4

Post by Tracker Supp-Stefan » Fri Aug 12, 2011 9:38 am

Hello gfindlay,

Attached is the main dialogue source from the C Drivers API example application.
Please check the PreparePrinter() and also make sure to check "3.1.2.14 Section Save" in the Drivers API manual file, for an explanation of the different Save options and how to make the drivers prompt for a file name.

Best,
Stefan
Attachments
MainDlg.cpp.rar
(2.26 KiB) Downloaded 184 times

Post Reply