Good afternoon,
I am working on a c# application for a client. One of the tasks is for it to insert a document, set some metadata and import any supporting document provided. I have everything working except for the importing of supporting documents. These documents will be in the form of PDF/ms-office format/or other types of content that is compatible with Laserfiche. I will not have access to the physical documents, no local copy to read from. So - only a binary or string representation that has been pulled from SQL or some other data store. This data is being passed into my routine as documentContents below.
FolderInfo parentFolder = Folder.GetFolderInfo(folder, _currentSession); DocumentInfo document = new DocumentInfo(_currentSession); document.Create(parentFolder, documentName, EntryNameOption.None); document.SetTemplate(templateName); ////////////////stuck here :( byte[] documentBytes = Encoding.UTF8.GetBytes(documentContents); PageInfo newPage = document.AppendPage(); System.IO.Stream pageStream = newPage.WritePagePart(PagePart.Image, documentBytes.Length); pageStream.Write(documentBytes, 0, documentBytes.Length); pageStream.Dispose(); newPage.Save(); ////////////////stuck here :( document.SetFieldValues(fv); document.Save(); return document;
The end result of this call is as follows:
Any help or guidance would be appreciated. I will continue to scour the support/answers forum as well.