Page 1 of 1

Notification of File Saved without RegisterWindowMessage

Posted: Fri Sep 12, 2014 4:17 pm
by DanCooperstock
I'm converting an app using the novaPDF SDK to one that cannot receive arbitrary events. Currently I'm using RegisterWindowMessage to register the events, and RegisterEventWindow to specify the window to receive the events, in my app that CAN receive arbitrary events.

Is there some other way to do this, to at least know when a print is done (or has an error, and if so, which error), for programming environments that can't handle arbitrary events?

I see in your Help the functions RegisterNovaEvent and WaitForNovaEvent. Can they be used to replace the code that I can no longer use? Something I don't understand with WaitForNovaEvent is how to tell which event was completed when it returns, and how to code it to be sure to catch all events. If that will work for me, could you point me at a code sample that uses it to handle multiple events (like page ended and file saved). (Or can you not get page ended events when you use RegisterNovaEvent, unlike when you use RegisterWindowMessage?)

Thanks.

Re: Notification of File Saved without RegisterWindowMessage

Posted: Mon Sep 15, 2014 1:56 pm
by Lorant (Softland)
The only way to receive multiple events is with the windows messages (using RegisterEventWindow / RegisterWindowMessage). The RegisterNovaEvent and WaitForNovaEvent cand be used with only one event. The usage is like this:

Just before starting a print job, you have to inform novaPDF printer that you want to wait for an event. Call:

pNova.RegisterNovaEvent("NOVAPDF_EVENT_FILE_SAVED")

Immediately after you send the job to the printer call:

pNova.WaitForNovaEvent(nMiliseconds, bTimeout)

This function will return when the event was signaled or when the time was elapsed. If the time was elapsed bTimeout is TRUE and if the event was signaled, bTimeout is FALSE.

There can be used one of these strings for events:
"NOVAPDF_EVENT_START_DOC"
"NOVAPDF_EVENT_END_DOC"
"NOVAPDF_EVENT_FILE_SAVED"

The events can be used only to wait in your application until the PDF is started or finished by the printer, but you cannot get an error code or information about print progress.

Re: Notification of File Saved without RegisterWindowMessage

Posted: Mon Sep 15, 2014 3:55 pm
by DanCooperstock
So I take it that if it times out there is no way to find out what the problem was. That doesn't seem like it would be adequate for our purposes.

Re: Notification of File Saved without RegisterWindowMessage

Posted: Wed Mar 30, 2022 12:13 pm
by Claudiu (Softland)
We always recommend using the latest version (v11 in this case).