RotateView suppress messagebox

PDF-XChange Viewer SDK for Developer's
(ActiveX and Simple DLL Versions)

Moderators: TrackerSupp-Daniel, Tracker Support, Vasyl-Tracker Dev Team, Sean - Tracker, Chris - Tracker Supp, Tracker Supp-Stefan, Ivan - Tracker Software

Post Reply
prosozial_schmitt
User
Posts: 52
Joined: Tue Dec 28, 2004 9:49 am

RotateView suppress messagebox

Post by prosozial_schmitt » Mon Dec 16, 2013 9:34 am

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

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

Re: RotateView suppress messagebox

Post by Tracker Supp-Stefan » Mon Dec 16, 2013 10:10 am

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);
       ...
       }
    }
...
}
...

prosozial_schmitt
User
Posts: 52
Joined: Tue Dec 28, 2004 9:49 am

Re: RotateView suppress messagebox

Post by prosozial_schmitt » Mon Dec 16, 2013 10:44 am

Hi Stefan,

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

Ok, I'll try this way.

Greetings
Hans-Peter

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

Re: RotateView suppress messagebox

Post by Tracker Supp-Stefan » Mon Dec 16, 2013 10:59 am

:)

prosozial_schmitt
User
Posts: 52
Joined: Tue Dec 28, 2004 9:49 am

Re: RotateView suppress messagebox

Post by prosozial_schmitt » Mon Dec 16, 2013 11:35 am

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

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

Re: RotateView suppress messagebox

Post by Tracker Supp-Stefan » Mon Dec 16, 2013 12:05 pm

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

prosozial_schmitt
User
Posts: 52
Joined: Tue Dec 28, 2004 9:49 am

Re: RotateView suppress messagebox

Post by prosozial_schmitt » Mon Dec 16, 2013 1:18 pm

Hello Stefan,

this solves my problem.
:D

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

Re: RotateView suppress messagebox

Post by Tracker Supp-Stefan » Mon Dec 16, 2013 1:22 pm

Glad to assist Hans-Peter!

Cheers,
Stefan

Post Reply