PDFPrinter.RestoreDefaultPrinter doesn't work

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
Sage Software
User
Posts: 15
Joined: Thu Mar 16, 2006 9:13 am

PDFPrinter.RestoreDefaultPrinter doesn't work

Post by Sage Software » Mon Nov 15, 2010 9:08 am

Dear Support,

in your code example "VbExCOM" (build 187) we commented out the line:

Code: Select all

PDFPrinter.SetAsDefaultPrinter
Nevertheless, after executing the line

Code: Select all

Set PDFPrinter = PDFPFactory.Printer("", "PDF-XChange 4.0 Sample", "<YOUR REG CODE>", "<YOUR DEV CODE>")
PDF-XChange is the default printer on that system.
After that the line

Code: Select all

PDFPrinter.RestoreDefaultPrinter
doesn't work, PDF-XChange is still the default printer. So this last line doesn't work.

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

Re: PDFPrinter.RestoreDefaultPrinter doesn't work

Post by Tracker Supp-Stefan » Tue Nov 16, 2010 5:07 pm

Hello,

I have asked our dev guys to comment on that and we would be back with an answer soon.

Best,
Stefan

Ivan - Tracker Software
Site Admin
Posts: 3630
Joined: Thu Jul 08, 2004 10:36 pm
Location: Vancouver Island - Canada
Contact:

Re: PDFPrinter.RestoreDefaultPrinter doesn't work

Post by Ivan - Tracker Software » Tue Nov 16, 2010 6:49 pm

PDF-XChange is the default printer on that system.
You mean PDF-XChange or PDF-XChange 4.0 Sample? Creation of the printer doesn't make it as default in system.
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.

Sage Software
User
Posts: 15
Joined: Thu Mar 16, 2006 9:13 am

Re: PDFPrinter.RestoreDefaultPrinter doesn't work

Post by Sage Software » Fri Nov 19, 2010 12:27 pm

We tested a little bit further. When we use "RestoreDefaultPrinter" with the older build 160, it is working. When we use it with the newest build 187 it is not working.

John - Tracker Supp
Site Admin
Posts: 8205
Joined: Tue Jun 29, 2004 10:34 am
Location: Vancouver Island - Canada
Contact:

Re: PDFPrinter.RestoreDefaultPrinter doesn't work

Post by John - Tracker Supp » Fri Nov 26, 2010 12:02 am

Hi,

I think the point your missing is that assuming you have not manually set PDF-XChange as the default printer and have not done so in your code - then simply initiating the printer will not set it as the default printer - it would appear that it is already the default printer before runnig the application - assuming that you have 100% for sure not set it as being so anywhere in your code.

If you are certain that it is being set as the default and is not already set as such - or anywhere in your code - please supply a small sample app showing this (both compiled and source/project code) and we will take a loo - please also advise the Windows O/S.

Pls not all files must be zipped if uploading here and all license info removed.

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

Sage Software
User
Posts: 15
Joined: Thu Mar 16, 2006 9:13 am

Re: PDFPrinter.RestoreDefaultPrinter doesn't work

Post by Sage Software » Fri Dec 03, 2010 7:50 am

Hi Tracker-Support,

here is a little sample application showing and describing our problem. It is a Microsoft Access project (.adp) using the old Access format (Access 2003), but it is developed in Access 2010.
As far as we know the problem occurs regardless of the operating system. But we explicitly tested it on Windows 7 64bit and Windows XP 32bit. And we already tested your newest build 188.

1. Unzip the file "PDFTest-Forum.adp" and start it with Access 2010
2. Open the module "basSageUtils" and add your reg code and dev code in the procedure "gInitPDFPrinter"
3. Open/Start the form "SageForm"
4. Press "Init PDF-Printer"
5. Read the messages carefully and you'll see, that "RestoreDefaultPrinter" doesn't work

We do need to call "SetAsDefaultPrinter" because otherwise the temporarily generated PDF-printer is not available in the Access printers collection (at least not in Windows Vista or Windows 7)

I hope, now you can reproduce our problem.

Best regards
Attachments
PDFTest-Forum.rar
(14.26 KiB) Downloaded 190 times

Ivan - Tracker Software
Site Admin
Posts: 3630
Joined: Thu Jul 08, 2004 10:36 pm
Location: Vancouver Island - Canada
Contact:

Re: PDFPrinter.RestoreDefaultPrinter doesn't work

Post by Ivan - Tracker Software » Fri Dec 03, 2010 5:23 pm

Sorry, but no, I cannot: by default I have my "HP Universal Printing PS" as default printer.
With you application I have sequence of the following messages:

"New PDF-Printer found = PDF-XChange 4.0 (1)"
"StandardPrinter after SetAsDefaultPrinter = PDF-XChange 4.0 (1)" (as it is default in system now)
"StandardPrinter after RestoreDefaultPrinter = HP Universal Printing PS"

Can you try on another computer if the problem exists? Looks like it is something specific for your system, it would be useful in assisting to see if this can be reproduced on another system as I cannot reproduce here ...
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.

Ivan - Tracker Software
Site Admin
Posts: 3630
Joined: Thu Jul 08, 2004 10:36 pm
Location: Vancouver Island - Canada
Contact:

Re: PDFPrinter.RestoreDefaultPrinter doesn't work

Post by Ivan - Tracker Software » Wed Dec 15, 2010 7:59 pm

Is the printer, which is thed default before PDF-XChange becomes the default printer, a network or local one?

If it's a network one, I'm glad to say the problem is fixed and the fix will be available in build 190 of the driver.

Please could you let us know - so we know if we need to continue to look for an issue when the original printer is a local one - currently we cannot reproduce any issue if the original printer
is a local printer.

Thanks
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.

Sage Software
User
Posts: 15
Joined: Thu Mar 16, 2006 9:13 am

Re: PDFPrinter.RestoreDefaultPrinter doesn't work

Post by Sage Software » Tue Sep 06, 2011 1:59 pm

Sorry for the delay. After the last answer we didn't check for newer ones.

Yes, the printer in question was a network printer. So we download the newest version and check for this problem again.

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

Re: PDFPrinter.RestoreDefaultPrinter doesn't work

Post by Tracker Supp-Stefan » Tue Sep 06, 2011 3:54 pm

:)

Post Reply