Using PDF-XChange Viewer SDK from WPF

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

Moderators: PDF-XChange Support, Daniel - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Vasyl - PDF-XChange, Ivan - Tracker Software, Stefan - PDF-XChange

AndreaCCS
User
Posts: 51
Joined: Wed Jun 16, 2010 2:54 pm

Using PDF-XChange Viewer SDK from WPF

Post by AndreaCCS »

Do you have any examples of embedding a viewer in a WPF form.

Regards
Andrea
User avatar
Vasyl - PDF-XChange
Site Admin
Posts: 2448
Joined: Thu Jun 30, 2005 4:11 pm

Re: Using PDF-XChange Viewer SDK from WPF

Post by Vasyl - PDF-XChange »

Hi, Andrea.

See the simple example in the attached archive and look to:
http://msdn.microsoft.com/en-us/library/ms742735.aspx

Best
Regards.
You do not have the required permissions to view the files attached to this post.
PDF-XChange Co. LTD (Project Developer)

Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
AndreaCCS
User
Posts: 51
Joined: Wed Jun 16, 2010 2:54 pm

Re: Using PDF-XChange Viewer SDK from WPF

Post by AndreaCCS »

Thanks for this. Do you have any plans to develop a native WPF component or a native Windows forms component?

Andrea
AndreaCCS
User
Posts: 51
Joined: Wed Jun 16, 2010 2:54 pm

Re: Using PDF-XChange Viewer SDK from WPF

Post by AndreaCCS »

Thanks this sample works well. The documentation (PDF-XChange Viewer SDK) states that when you call for example OpenDocument it should return a result

HRESULT OpenDocument(BSTR SourceFileName,BSTR OpenPassword,LONG* ID,LONG Flags);

But the function in the sample code is a void function so how can I ensure the file is opened properly (Or does it just throw an exception instead or returning an error). Is this the case for all the functions?

I would also like to say thanks for your (very) speedy response to my questions so far.

Andrea
Andrea
User avatar
Stefan - PDF-XChange
Site Admin
Posts: 19913
Joined: Mon Jan 12, 2009 8:07 am

Re: Using PDF-XChange Viewer SDK from WPF

Post by Stefan - PDF-XChange »

Hello Andrea,

Taken directly from the manual:

Code: Select all

Return  Value
Returns S_OK if successful, or an error value otherwise. To obtain the text description of a
received error code, use GetTextFromResult.
where S_OK is the generic HRESULT for success.

Best,
Stefan
AndreaCCS
User
Posts: 51
Joined: Wed Jun 16, 2010 2:54 pm

Re: Using PDF-XChange Viewer SDK from WPF

Post by AndreaCCS »

I agree that is what it says in the manual but from C# all functions have void types e.g
void AxCoPDFXCview.OpenDocument(string sourceFileName)

I have looked at your examples more thoroughly now and I think if the function fails it throws an exception which has to be handled instead of returning a result.
Andrea
User avatar
Stefan - PDF-XChange
Site Admin
Posts: 19913
Joined: Mon Jan 12, 2009 8:07 am

Re: Using PDF-XChange Viewer SDK from WPF

Post by Stefan - PDF-XChange »