Greetings Laserfiche Community,
I am having some trouble importing electronic documents with the DocumentImporter.ImportEdoc() method and a data stream. SDK documentation states you can import an electronic document by using the method above and passing it a mimetype and a stream.
Imports data from a stream into the current Laserfiche document as an electronic document, replacing any existing electronic document
This is some sample test code that I am using to try and figure out what I am doing wrong, but I am not sure I am missing. Any help would be greatly appreciated. Thank you!
using (FileStream file = File.OpenRead("G:\\Laserfiche Import Agent 9 Quick Start.pdf"))
{
//var ms = new MemoryStream();
//file.CopyTo(ms);
DocumentImporter DI = new DocumentImporter();
DI.Document = docInfo; //docInfo was initialized earlier in code that is not attached
DI.ImportEdoc("application/pdf", file);
}