I have been struggling to solve this error for days now, And I find nowhere to get any help on this.. Am using SDK8.2 and what I am trying to accomplish is DocumentExportation. I am using C# and aspx.
When I ran the same scripts in another server it produce no errors.
The following are the source codes I have written to accomplish this..
using System; using System.Configuration; using System.Data; using System.IO; using System.Drawing; using System.Drawing.Imaging; using System.Linq; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.HtmlControls; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Xml.Linq; using LFSO80Lib; using DocumentProcessor80; using System.Text; public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { lbtest.Text = ""; LFSO80Lib.LFApplication app = new LFSO80Lib.LFApplication(); LFSO80Lib.LFServer serv = (LFSO80Lib.LFServer)app.GetServerByName("");// Laserfiche Server LFSO80Lib.LFDatabase db = (LFSO80Lib.LFDatabase)serv.GetDatabaseByName("");//Repository Name LFSO80Lib.LFConnection conn = new LFSO80Lib.LFConnection();//Instatiatianing New Connection conn.UserName = ""; //User name conn.Password = ""; // "Password; conn.Create(db);// Creating new Connection string id = Request.QueryString["ID"]; string docType = Request.QueryString["docType"]; string docTypee = ""; LFSearch mySearch = (LFSearch)db.CreateSearch(); if(docType == "regCard"){ mySearch.Command = @"{ LF: LOOKIN = ""Members""} & {[Registration Card]:[Member ID]="+id+"} "; docTypee = "Registration Form"; }else if (docType == "claimDoc") { mySearch.Command = @"{ LF: LOOKIN = ""Members""} & {[Claims Documents]:[Member ID]="+id+"} "; docTypee = "Claim Documents"; }else if (docType == "pensionDoc") { mySearch.Command = @"{ LF: LOOKIN = ""Members""} & {[Pension]:[Member ID]="+id+"} "; docTypee = "Pension Documents"; }else if (docType == "corrDoc") { mySearch.Command = @"{ LF: LOOKIN = ""Members""} & {[Correspondences]:[Member ID]="+id+"} "; docTypee = "Correspondences"; }else if( docType == "ContrSchedule"){ mySearch.Command = @"{ LF: LOOKIN = ""Employers""} & {[Contribution Schedule]:[Employer ID]="+id+"} "; docTypee = "Contribution Schedule"; }else if(docType == "empCorrespondences"){ mySearch.Command = @"{ LF: LOOKIN = ""Employers""} & {[Employer Correspondences]:[Employer ID]="+id+"} "; docTypee = "Correspondences Documents"; }else if(docType == "empRegCard"){ mySearch.Command = @"{ LF: LOOKIN = ""Employers""} & {[Employer Registration Document]:[Employer ID]="+id+"} "; docTypee = "Registration Documents"; } else if(docType == "memBenefits"){ mySearch.Command = @"{ LF: LOOKIN = ""Members""} & {[Member Claim Documents]:[Member ID]="+id+"} "; docTypee = "Member Claim Documents"; } mySearch.BeginSearch(true); // Instantiates a LFsearchListingParams object. LFSearchListingParams NewParams = new LFSearchListingParams(); NewParams.AddStandardColumn(Column_Type.COLUMN_TYPE_TEMPLATENAME); // Sort the results listing by entry name in // ascending order. NewParams.set_ColumnTypeToSortBy(Column_Type.COLUMN_TYPE_NAME, Sort_Direction.SORT_DIRECTION_ASC); // Gets the search results listing. LFSearchResultListing ResultListing = (LFSearchResultListing)mySearch.GetSearchResultListing(NewParams, 0); // Display the name of the template associated // with each search result if(ResultListing.RowCount == 0){ lbtest.Text +="No "+docTypee+" has been Uploaded<br><br>"; Console.Write(lbtest.Text); }else if(ResultListing.RowCount == 1){ lbtest.Text +=ResultListing.RowCount; Console.Write(lbtest.Text); ILFCollection AllHits = (ILFCollection)mySearch.GetSearchHits(); LFSearchHit Hit = (LFSearchHit)AllHits[1]; ILFEntry EntryHit = (ILFEntry)Hit.Entry; lbtest.Text += EntryHit.FullPath; Console.WriteLine(lbtest.Text); LFSO80Lib.ILFEntry disps = (LFSO80Lib.ILFEntry)db.GetEntryByPath(EntryHit.FullPath); if (disps.EntryType == LFSO80Lib.Entry_Type.ENTRY_TYPE_DOCUMENT){ lbtest.Text +="Document has been Found<br><br>"; Console.Write(lbtest.Text); LFSO80Lib.LFDocument doc = (LFSO80Lib.LFDocument)disps; LFSO80Lib.LFDocumentPages docpages = (LFSO80Lib.LFDocumentPages)doc.Pages; DocumentExporter exporter = new DocumentExporter(); exporter.AddSourcePages(docpages); exporter.Format = DocumentProcessor80.Document_Format.DOCUMENT_FORMAT_PDF; exporter.Scale = 8000; byte[] imageStream = null; imageStream = (byte[])exporter.Export(); doc.Dispose(); conn.Terminate(); Response.ContentType = "Application/PDF"; Response.BinaryWrite(imageStream); Response.End(); } }else{ lbtest.Text +="More than One Document has been Found<br><br>"; Console.Write(lbtest.Text); for(int i=1; i<=ResultListing.RowCount; i++){ ILFCollection AllHits = (ILFCollection)mySearch.GetSearchHits(); LFSearchHit Hit = (LFSearchHit)AllHits[i]; ILFEntry EntryHit = (ILFEntry)Hit.Entry; // lbtest.Text += EntryHit.FullPath+" "+ Environment.NewLine; lbtest.Text += i+". <a href='https://172.20.20.180/interface-2/docByPath.aspx?path="+EntryHit.FullPath+"' target=\"docss\">"+EntryHit.Name+"</a><br>"; Console.WriteLine(lbtest.Text); } } conn.Terminate(); } }