V4 Update Issues

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, Chris - Tracker Supp, Sean - Tracker, Tracker Supp-Stefan

Tectura
User
Posts: 1
Joined: Sun Sep 19, 2010 11:19 pm

V4 Update Issues

Post by Tectura »

We have had the PDF API working successfully with our application for some time using the old API tools, i have downloaded the latest API but we are not getting the expected results.

In the old version we used to directly set the registry to determine the file save location as well as other properties, this worked fine

What we used to do was

1. Setup PDF Parameters i.e FileSave etc
2. Window Messages were used to trap print status and completion etc
3. Run Print Job to PDF XChange Printer from Application
4. Success , PDF was created where we wanted

New Environment is Windows 7, 64Bit Enterprise.

Simply Put ..

Old Code Was

Code: Select all

 SubKey.SetValue("Save.FullFileName", "c:\Working\TestReport.pdf")
        SubKey.SetValue("Save.ShowSaveDialog", "No")
        SubKey.SetValue("Save.WhenExists", "Overwrite")
New Code is

Code: Select all


 Public PDFPFactory As New PXCComLib.CPXCControlEx
        Public WithEvents PDFPrinter As PXCComLib.CPXCPrinter

 PDFPrinter = PDFPFactory.Printer("", "PDF-XChange 4.0", "", "")
                PDFPrinter.Option("Save.ShowSaveDialog") = False
                PDFPrinter.Option("Save.File") = "c:\tmp\pdf\Test.pdf"
                PDFPrinter.Option("Save.WhenExists") = "1"
This is being printed against the installed PDF-XChange Printer, i.e not creating a temporary printer.


We are always now getting the print save dialog instead of the file being saved where we asked it to go, Am I missing something!!




Thanks in Advance :)
User avatar
Ivan - Tracker Software
Site Admin
Posts: 3550
Joined: Thu Jul 08, 2004 10:36 pm
Location: Vancouver Island - Canada

Re: V4 Update Issues

Post by Ivan - Tracker Software »

"Problem" is because this code

Code: Select all

PDFPFactory.Printer("", "PDF-XChange 4.0", "", "")
doesn't "attach" you to the installed printer, it always creates a new (instance) of the printer. If a printer with the specified name already exists (and you have used the standard name of PDF-XChange for the printer), AX will create a new name based on the passed one.

Your application should therefore use the PDFPrinter.name property to get the name of the created printer and use this for printing.
Tracker Software (Project Director)

When attaching files to any message - please ensure they are archived and posted as a .ZIP, .RAR or .7z format - or they will not be posted - thanks.