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

egekko
User
Posts: 2
Joined: Tue May 27, 2008 8:22 am

Problem, v4

Post by egekko »

Hi

Trying to make a PDF but get an error saying "the printer not avavibly"

Part of the code:

Code: Select all

'PDF-XChange 4.0
 Dim xpxcSObject As New PXCComLib.CPXCControlEx
 Dim PDFPrinter As PXCComLib.CPXCPrinter
        
Set PDFPrinter = xpxcSObject.Printer("", "PDF-XChange 4.0 Sample", "xxxx-xxxx-xxxx-xxxx-xxxx-xxxx", "<YOUR DEV CODE>")
        
PDFPrinter.SetAsDefaultPrinter
        
PDFPrinter.ResetDefaults
PDFPrinter.Option("Save.File") = slask & "\uppdragsforslag.pdf"
PDFPrinter.Option("Save.SaveType") = "Save"
PDFPrinter.Option("Save.ShowSaveDialog") = "No"
PDFPrinter.Option("Save.WhenExists") = "Overwrite"
        
PDFPrinter.Option("Compression.Graphics") = "No"
PDFPrinter.Option("Compression.Text") = "No"
        
PDFPrinter.Option("Save.RunApp") = False
PDFPrinter.Option("Save.RunCustom") = "No"
        
rptName = "rptUppdragsFörslag"
DoCmd.OpenReport rptName
        
PDFPrinter.RestoreDefaultPrinter

DoCmd.OpenReport rptName gives the error
User avatar
John - Tracker Supp
Site Admin
Posts: 5219
Joined: Tue Jun 29, 2004 10:34 am
Location: United Kingdom

Re: Problem, v4

Post by John - Tracker Supp »

Please advise the Windows OS in use and also the Driver verson/build

also - can you print direct to the printer (albeit in trial mode) from say MS Word or Word Pad etc ?

thanks
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.

Best regards
Tracker Support
http://www.tracker-software.com
User avatar
John - Tracker Supp
Site Admin
Posts: 5219
Joined: Tue Jun 29, 2004 10:34 am
Location: United Kingdom

Re: Problem, v4

Post by John - Tracker Supp »

Also ..

"DoCmd.OpenReport" prints the report on the default printer ? - if so what is this set to?

Also - would be useful to see a sample of your Access database too.

thanks
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.

Best regards
Tracker Support
http://www.tracker-software.com
egekko
User
Posts: 2
Joined: Tue May 27, 2008 8:22 am

Re: Problem, v4

Post by egekko »

It is MS Access. I think there is some issue with v.4. The line:

"Set PDFPrinter = xpxcSObject.Printer("", "PDF-XChange 4.0 Sample", "xxxx ....." "

Creates a temporary instance of PDF-XC. Next line:

"PDFPrinter.SetAsDefaultPrinter"

Sets it as default printer, if I step the code and leave it after that line I can se the teporary printer in my control panel, I can print with it. (ie. testpage).

If I now open a new empty Access and creates a form to have something to print, I can print using this teporary printer from "File Print ...", as it is the systems default printer it would be selected if I use the Print button in the menu bar. But here I get the same error as when trying to print to it from my code.

File ... Print: Selecting the temprary instance (Selected by default) Works!
Direct print to default printer (the temporary instance) Fails!

If I in my code comment the line "PDFPrinter.SetAsDefaultPrinter" and select my ordinary printer as default the code runs fine and the report are printed i my printer.
User avatar
John - Tracker Supp
Site Admin
Posts: 5219
Joined: Tue Jun 29, 2004 10:34 am
Location: United Kingdom

Re: Problem, v4

Post by John - Tracker Supp »

Please zip and send an access database to test with and we will advise

thanks.
If posting files to this forum - you must archive the files to a ZIP, RAR or 7z file or they will not be uploaded - thank you.

Best regards
Tracker Support
http://www.tracker-software.com