I'm using a SDK script to export documents to a windows folder. The script successfully moves the documents to the correct location, but they are empty 0KB files. These are image files, so all of them are TIF/TIFF files, some have multiple pages, but I've tried both multiple page and single page documents with the same outcome. I've also tried using the ExportPdf method with the same outcome. I've also tried giving the Windows Folder full permissions for the user and that didn't make a difference. When I copy the files into the locations in Laserfiche in the process right before the SDK Script, it moves the documents into the folders just fine and the image(s) are there. Below is my script, and my current workflow.
protected override void Execute() { // Get Path to Windows Folder for Exports String exportFolder = (String)GetTokenValue("DestinationPath"); DocumentInfo doc = (DocumentInfo)this.BoundEntryInfo; DocumentExporter docExporter = new DocumentExporter(); String exportPath = System.IO.Path.Combine(exportFolder, doc.Name + ".tif"); docExporter.PageFormat = DocumentPageFormat.Tiff; // this parameter will be changed to find the number of pages int pageNumber = 1; using (FileStream fs = File.OpenWrite(exportPath)) docExporter.ExportPage(doc, pageNumber, fs); }