Search:     Advanced search
Browse by category:
Glossary | Contact Us



[novaPDF SDK] SetDefaultPrinter doesn't work after RestoreDefaultPrinter is called

Add comment
Votes: 0
Comments: 0
Q: I have set-up a workflow for novaPDF SDK that does this: first it calls SetDefaultPrinter() to set novaPDF as the default printer, then it sends a print job to it, and after that reverts back to the previous default printer calling the RestoreDefaultPrinter() function. However, after the first cycle of this workflow, novaPDF isn't set as the default printer anymore even if I use the SetDefaultPrinter() function again. Why?

A: This usually happens when the call to the RestoreDefaultPrinter() function is sent too fast, before the print job is actually assigned to a printer queue. In our samples (converter samples), we  wait for a message from novaPDF that the job was finished before calling the RestoreDefaultPrinter().

An easier way is to use some events from novaPDF. Before starting the print job, you have to inform novaPDF that you want to wait for an event so you should call:
 
pNova->RegisterNovaEvent("NOVAPDF_EVENT_FILE_SAVED");
 
After you send the job to the printer, call this function:
 
pNova->WaitForNovaEvent(ULONG p_nMiliseconds);
 
This function will return when the event was signaled (which means the PDF is finished) or when the time was elapsed. After that you can call the RestoreDefaultPrinter() function.
Others in this Category
document [novaPDF SDK] - I want to change novaPDF printer option settings, do I need novaPDF SDK for that?
document Installing novaPDF OEM with command line parameters
document How to set programmatically the page related settings (page size, layout) via novaPDF SDK
document [novaPDF SDK] How to generate a pdf file without the Save As dialog
document How to install (or uninstall) novaPDF silently
» More articles



RSS

© 2002-2008 Softland. All Rights Reserved.
PDF Creator novaPDF
Create PDF for a paperless office
home Home   contact usContact us   partnershipsPartnerships   bookmarkBookmark   Site updated: 12-Mar-2008
DownloadsDownload

Download, install and use novaPDF. Latest version: 5.4 build 255

Download PDF creator
promotionsSpecial Offers

Current discounts:
- up to 25% for Desktop Editions
- up to 25% for Server Editions
- 20% Academic Discount
- up to 16% for Developer Tools

buyBuy Now
Professional edition $39.95
(Save $10)
Standard edition $29.95
(Save $10)
Lite edition $19.95
(Save $5)
Buy Now
newsLatest News

novaPDF 5.4 released
February 11, 2008

What’s new (read more):
 » Added Copy Text/Image Watermarks dialog
 » Added "Lookup Address" option when sending emails
 » Corrected rotated and vertical texts conversion
 » Corrected conversion from WordArt, MS Word backgrounds and MS Visio drawings
 » Unistaller deletes now the driver files

newsletter News via Email | rss feed News via RSS
sdkDeveloper Tools

novaPDF SDK is a software development toolkit that can be used by software developers and programmers to add the ability to create PDF files in their applications.
novaPDF OEM is a PDF solution that programmers can use to generate PDF files that will be post-processed by their applications. […]

Reviews & User QuotesPDF Creator Reviews

"novaPDF is a really neat tool. Basically, it’s a PDF printer driver that prints to a PDF file instead of paper.

See more reviews about nova PDF
[…] novaPDF is a great product that works without forcing the user to configure anything. The convenience alone is worth the money." […]

Jason Pullara, Editor
Currently supported languagesLanguages

News:
- Finnish and Arabic languages added.
- Spanish, French, Swedish and Chinese Traditional languages updated.

Help us translate novaPDF and we will give you licenses for novaPDF Professional and mention you on the Languages page. […]

awardsAwards

novaPDF received the Editor’s Pick from Soft32, a major download site:

PDF creator reviews

See the Awards page for more ratings.

knowledgebaseKnowledgebase articles

Latest articles on how to:
 » Create PDF files
 » Convert JPG to PDF
 » Convert Powerpoint to PDF
 » Convert Publisher to PDF
 » Convert web pages to PDF
Full article list in the knowledgebase.