Page 1 of 1

RotateView suppress messagebox

Posted: Mon Dec 16, 2013 9:34 am
by prosozial_schmitt
Hello,

I want to rotate the view of the opened pdf-document (pdf_ax) with commands 33079 rotateCCW/33078 rotateCW.
Is it possible to suppress the messagebox "Note: this function will rotate pages for this work-session only....".

I've tried PXCVA_Flags.PXCVA_NoUI and PXCVA_Flags.PXCVA_None in doVerb and also in openDocument, but this doesn't work.

Is there another way to do this?

Greetings
Hans-Peter

Re: RotateView suppress messagebox

Posted: Mon Dec 16, 2013 10:10 am
by Tracker Supp-Stefan
Hi Hans Peter,

You will need to handle a PXCVA_OnDisplayPrompt prompt event, and the event name is:
Prompts.RotatePagesViewWarn

In pseudocode it could look like:

Code: Select all

...
function OnEvent(Type, Name, DataIn, DataOut, Flags)
{
 ...
    if (Type == PXCVA_OnDisplayPrompt)
    {
       if (Name == "Prompts.RotatePagesViewWarn")
       {
         // skip original dialog display
         SetProperty("Prompts.RotatePagesViewWarn.UserChoice",
                      DataIn("OK"), 0);
       ...
       }
    }
...
}
...

Re: RotateView suppress messagebox

Posted: Mon Dec 16, 2013 10:44 am
by prosozial_schmitt
Hi Stefan,

this is a really quick reply :)
Thank you very much.

Ok, I'll try this way.

Greetings
Hans-Peter

Re: RotateView suppress messagebox

Posted: Mon Dec 16, 2013 10:59 am
by Tracker Supp-Stefan
:)

Re: RotateView suppress messagebox

Posted: Mon Dec 16, 2013 11:35 am
by prosozial_schmitt
Hi Stefan,

I've tried it, but it does not work?
There is no eventtype "PXCVA_OnDisplayPrompt" send if I catch and print the events.
Example after sending 33078 / RotateCW:

Private Sub AxCoPDFXCview1_OnEvent(ByVal sender As System.Object, ByVal e As AxPDFXCviewAxLib._IPDFXCviewEvents_OnEventEvent) Handles AxCoPDFXCview1.OnEvent
Debug.Print("Eventtype: " & e.type.ToString & ", Eventname: " & e.name)
If e.type = PDFXCviewAxLib.PXCVA_EventTypes.PXCVA_OnPropertyChanged Then
OnPropertyChanged(e.name)
End If
End Sub

Debug.Print of OnEvent:

Eventtype: 4, Eventname: Global::BeginModal
=> MESSAGEBOX DISPLAYS HERE => after closing see below.
Eventtype: 4, Eventname: Global::EndModal
Eventtype: 1, Eventname: Documents[#4095].Pages.DisplayRotation
...

Re: RotateView suppress messagebox

Posted: Mon Dec 16, 2013 12:05 pm
by Tracker Supp-Stefan
Hi Hans-Peter,

Hmm - there is a prompt so this event should be fired, but I also had some problems when testing here on my end.
However setting

Code: Select all

axCoPDFXCview1.SetProperty("Prompts.RotatePagesViewWarn", "false", 0);
directly in the code of the C# full demo (without waiting for an event first) properly suppresses the notification from appearing. So please just set that directly after initializing the control and all should be well.

Regards,
Stefan

Re: RotateView suppress messagebox

Posted: Mon Dec 16, 2013 1:18 pm
by prosozial_schmitt
Hello Stefan,

this solves my problem.
:D

Re: RotateView suppress messagebox

Posted: Mon Dec 16, 2013 1:22 pm
by Tracker Supp-Stefan
Glad to assist Hans-Peter!

Cheers,
Stefan