SilverDox: System.Net.WebException: The remote server returned an error: NotFound.

69 views
Skip to first unread message

Apurva Petkar

unread,
Jul 10, 2013, 8:32:38 AM7/10/13
to silv...@googlegroups.com
Hi friends,

I am using trial version of SilverDoxSDK for viewing xod files in browser. I am completely new to silverlight.
The local URL of my SilverDoxTutorial application is http://localhost:58018/
When I try to access http://www.pdftron.com/silverdox/samples/ClientBin/PDFTron_PDF2XPS_User_Manual.xod file, the viewer shows the file with no issues.
When I try a file placed in Documents folder of the local site http://localhost:58018/
All the time I get is System.Net.WebException: The remote server returned an error: NotFound.
I also tried placing the file in ClientBin folder as is seen in the URL of PDFTron.
The code I am using is as below

public MainPage()
{
            InitializeComponent();
            LoadDocument();
            
}
public void LoadDocument()
 {
            //Uri documentUri = new Uri("http://localhost:58018/ClientBin/multipage.xod");
            Uri documentUri = new Uri("http://localhost:58018/Documents/multipage.xod");
            HttpPartRetriever myHttpPartRetriever = new HttpPartRetriever(documentUri);
            this.MyDocumentViewer.LoadAsync(myHttpPartRetriever, OnLoadAsyncCallback);
}
public void OnLoadAsyncCallback(Exception ex)
{
            if (ex != null)
            {
                //An error has occurred
                System.Diagnostics.Debug.WriteLine(ex.StackTrace);
                MessageBox.Show("Error loading document: " + ex.Message);
            }
            MyDocumentViewer.SetFitMode(DocumentViewer.FitModes.Panel, DocumentViewer.FitModes.None);
}

Also,
I have placed the files clientaccesspolicy.xml and crossdomain.xml at root of my local site http://localhost:58018/ as mentioned in here 

Are there any settings required to make the xod file available publicly like the one given by PDFTron i.e http://www.pdftron.com/silverdox/samples/ClientBin/PDFTron_PDF2XPS_User_Manual.xod

As per the functionality I need to implement I can't access local files with OpenFileDialog.
Can you please suggest anything?

Thanks again for all the last support that I have received from support team of PDFTron.

Support

unread,
Jul 10, 2013, 4:34:00 PM7/10/13
to silv...@googlegroups.com

The error is because the webserver can't find the file. I believe the VS changes to port of its development server every time you run the program, so make sure that your program is talking to the correct localhost. Also double check that the name of the .xod file is correct, and that the root of the web server is the local folder upon which you are basing your paths. If it makes things any easier, you could use the Silverlight class WebClient for testing. If you're having trouble configuring the VS development server, then you could put the .xod file on a different web server, but you would need access to its root to put the cross domain permission file(s). Fiddler is useful when monitoring web traffic, but note what you have to do when using it to monitor localhost

However, if your requirements call for opening local files, then using an HttpPartRetreiver will require your clients to be running a web server on their local machine, which seems unusual. For security reasons Silverlight doesn't allow programmatic access to the local file system except through the file picker dialog.

Apurva Petkar

unread,
Jul 12, 2013, 9:05:27 AM7/12/13
to PDFTron SilverDox on behalf of Support
Thanks for the reply James. Please ignore my last incomplete mail. I accidently sent it. Sorry for this.

In conversion into XOD format, the file was damaged and I tried a different method of conversion which found on forum of PDFTron. Then I used HttpStreamingPartRetriever instead of HttpPartRetriever and I could see the file loaded in document viewer.

Can I please know, customizing the menu that comes up on right click on document viewer dynamically?
According to the functionality, I need to customize the right click pop up menu in such a way that,
according to some parameters I pass to the page URL I want to either hide the pop up menu itself or just disable/hide the "Copy" in the pop up menu.

I went through your reply on the forum


I got to know that need to override OnContentMouseRightButtonDown() of Document viewer.
But not very much clear how to do it.
Is it possible to achieve the requirement I am running with?



--
You received this message because you are subscribed to the Google Groups "PDFTron SilverDox" group.
To unsubscribe from this group and stop receiving emails from it, send an email to silverdox+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Regards,
Apurva R. Petkar
(Mobile No: 9960432604)

Reply all
Reply to author
Forward
0 new messages