Not able to create Scribd.Net.Document class Object

Apr 25, 2011 at 12:13 PM

Hi,

 I am trying to download selected document which is already stored in Scribd. I am using file reference id (eg- 53791442) which is used to get my file from scribd.

I am using following code to get file details.

                  Scribd.Net.Document _doc = new Scribd.Net.Document(Convert.ToInt32(Doc.DOCUMENT_URL));  <---------- This line showing error while running
                _doc = Document.Download(Convert.ToInt32(Doc.DOCUMENT_URL));
                  this.embedLocation.Controls.Add(new HtmlGenericControl("div"));
                 ((HtmlGenericControl)this.embedLocation.Controls[0]).InnerHtml = _doc.GetEmbedCode();

But the following error is showing

Object reference not set to an instance of an object.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:

Line 156:                Scribd.Net.Document _doc = new Scribd.Net.Document(Convert.ToInt32(Doc.DOCUMENT_URL));

[NullReferenceException: Object reference not set to an instance of an object.]
Scribd.Net.Document.Download(Int32 documentId) +1867
Scribd.Net.Document..ctor(Int32 documentId, Size thumbnailSize) +48
Scribd.Net.Document..ctor(Int32 documentId) +79
SalesPortal_ProposalDocuments.gvFilesToReview_RowCommand(Object sender, GridViewCommandEventArgs e) in d:\Development\Clients\Transact\Development\CoreAccelerator_Project\CoreAccelerator_Solution\AcceleratorNet\SalesPortal\ProposalDocuments.aspx.cs:156
System.Web.UI.WebControls.GridView.OnRowCommand(GridViewCommandEventArgs e) +108
System.Web.UI.WebControls.GridView.HandleEvent(EventArgs e, Boolean causesValidation, String validationGroup) +112
System.Web.UI.WebControls.GridView.OnBubbleEvent(Object source, EventArgs e) +95
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37
System.Web.UI.WebControls.GridViewRow.OnBubbleEvent(Object source, EventArgs e) +123
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37
System.Web.UI.WebControls.LinkButton.OnCommand(CommandEventArgs e) +118
System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument) +135
System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +175
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565

Please Help me to solve this issue