Hello Support,
I have bought the XChange Viewer from few days and trying to make something useful for my application.
The first problem I am facing is with the SetDocumentProperty, for setting the Pages.Zoom FitPage just after an opening of a PDF.
I modified the VB6 sample that you provide, in the Private Sub Command2_Click() as follows:
Private Sub Command2_Click()
On Error GoTo ErrLabel
Dim iId As Long
Dim iFl As Long
iId = 0
iFl = 0
If cb_OpenWithoutUI.Value = 1 Then
iFl = PXCVA_Flags.PXCVA_NoUI
End If
Call CoPDFXCview1.OpenDocument(t_OpenDocFileName.Text, t_OpenDocPass.Text, iId, iFl)
Dim bsVerb As String
Dim bsAction As String
bsAction = "FitPage"
bsVerb = "Pages.Zoom"
err.Number = 0
Call CoPDFXCview1.SetDocumentProperty(0, bsVerb, bsAction, 0)
SettingZoom = False
Exit Sub
ErrLabel:
MsgBox (err.Description)
End Sub
Basically, what I need is to open and automatically fit-to-page the PDF just with one click ... but the above "sub" won't work, and the SetDocumentProperty returns always an error
Can you please suggest me what is wrong with the procedure ?
Do I need to wait the open to be finished ?
Thanks,
Ciro Ettorre
SetDocumentProperty won't work
Moderators: PDF-XChange Support, Daniel - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Paul - PDF-XChange, Vasyl - PDF-XChange, Ivan - Tracker Software, Stefan - PDF-XChange
-
Corwin - Tracker Sup
- User
- Posts: 664
- Joined: Tue Nov 14, 2006 12:23 pm
Re: SetDocumentProperty won't work
Try to use document ID when you calling SetDocumentProperty function. In your case you can use iId variable.
Call CoPDFXCview1.SetDocumentProperty(iId, bsVerb, bsAction, 0)
-
ciroettorre
- User
- Posts: 25
- Joined: Tue Dec 30, 2008 9:59 am
Re: SetDocumentProperty won't work
with the iId it works, but, from the documentation, I see that I could use the 0 as "current document"
Is this no more true ?
Is this no more true ?
-
Corwin - Tracker Sup
- User
- Posts: 664
- Joined: Tue Nov 14, 2006 12:23 pm
Re: SetDocumentProperty won't work
I’m afraid that this is small problem in PDF-XChange Viewer ActiveX. Anyway this will be fixed in next build, according to the documentation.