Hi, I have recently run a Workflow to change .1 types to .tiff type, however the file can be open correctly, but there is no preview.
Is there something that I missed in the extension change that prevents the preview?
Thanks
Hi, I have recently run a Workflow to change .1 types to .tiff type, however the file can be open correctly, but there is no preview.
Is there something that I missed in the extension change that prevents the preview?
Thanks
For some reason, when adding the reference for version 11 of Laserfiche.DocumentServices, after you add it, you must close out of the Script Editor and come back in. Then remove the incorrect version and re add the correct version.
How exactly are you changing the extension?
Hi I used the SDK through a workflow, loop through all the mis-filed .1 documents and changed them to .doc, .xls, .tiff etc
Right, but what code are you using? It's difficult to determine what might be going wrong without knowing the specific steps you are using to make the change.
The code
protected override void Execute()
{
string mimeType = GetTokenValue ("FileExtension").ToString();
DocumentInfo di=(DocumentInfo)this.BoundEntryInfo;
int yourEntryID = di.Id;
//string x = di.GetFieldValue("Extension").ToString();
//DocumentInfo docInfo = new DocumentInfo(yourEntryID, RASession);
di.Extension = mimeType;
//docInfo.MimeType= "application/vnd.ms-excel";
di.Save();
di.Dispose();
}
The issue you may be having is that TIFF is the native format for pages in a Laserfiche document, but the Extension property is for Electronic Documents attached to the Laserfiche entry.
Something like a docx, xlsx, or pdf document would have the corresponding file extension for that electronic document.
However, a document with TIFF pages is the native format and would not have an extension set unless there was a separate electronic document attached.
That being said, it really depends on how the documents were imported in the first place because if they were imported with the wrong file extension that could've prevented it from generating the pages properly.
Native Document with TIFF pages
Electronic Document
Hi thanks, is there anyway this data can be fixed either through the database or via workflow / sdk?
You should be able to "Generate Pages" through the Desktop Client, and then remove the electronic file.
If you're on a relatively recent version and you have a Distributed Computing Cluster server configured, you can generate pages for PDF documents with the Schedule PDF Page Generation workflow activity.
To remove the electronic file, you can either use an SDK script in workflow or just move the generated pages into a new entry.
If you don't have a DCC server, the only other way aside from manually generating pages in the client or reimporting them, would be Quick Fields.
Jason, they are not talking about converting PDFs. They have TIFF images that where brought into the repository as electronic files and they need them converted to LF pages.
You're right, I forgot about that part.
I think you could still use Quick Fields, SDK scripts, or something more elaborate like exporting and reimporting with Import Agent.
If the electronic file is already in a valid tiff format, then an SDK script may be the best approach.
This can be done with a workflow script. Ensure that in your SDKScript activity you add a reference to the Laserfiche.DocumentServices DLL that matches the same version as the scripts Laserfiche.RepositoryAccess and add the Imports statement at the top of the script.
Protected Overrides Sub Execute() 'Write your code here. The BoundEntryInfo property will access the entry, RASession will get the Repository Access session If BoundEntryInfo.EntryType = EntryType.Document Then Using Doc As DocumentInfo = DirectCast(BoundEntryInfo, DocumentInfo) ' Only Export if it has Electronic TIFF If Doc.IsElectronicDocument Then IF Doc.Extension.ToLower() = "tiff" Or Doc.Extension.ToLower() = "tif" Then ' Create new Document Exporter Dim DX As DocumentExporter = New DocumentExporter() ' Create MemoryStream to hold the Exported document Using ms As System.IO.MemoryStream = New System.IO.MemoryStream() ' Export electronic document to memorystream DX.ExportElecDoc(Doc, ms) If ms IsNot Nothing Then ' Create Document Imported Dim DI As DocumentImporter = New DocumentImporter() DI.Document = Doc ' Write file to LF Document DI.ImportImages(ms) ' Remove the Electronic File from the document Doc.DeleteEdoc() Doc.Save() End If End Using End If End If End Using End If End Sub
Hi under details it says version 11.0.0.0, and directory service is 4.0.10_2 & 4.0.10_4, and even tried an 11, but get the followeing error
Warning 1 Assuming assembly reference 'Laserfiche.RepositoryAccess, Version=10.2.0.0,
Culture=neutral, PublicKeyToken=3f98b3eaee6c16a6'
matches 'Laserfiche.RepositoryAccess, Version=11.0.0.0,
Culture=neutral, PublicKeyToken=3f98b3eaee6c16a6', you may need to supply runtime policy
Fix FIle Extension
thanks again
For some reason, when adding the reference for version 11 of Laserfiche.DocumentServices, after you add it, you must close out of the Script Editor and come back in. Then remove the incorrect version and re add the correct version.
thanks .save works great, and I can compile the WF SDK, I will look to see which one suits my needs as there could be a large number of TIF files I need to sort, many thanks.
Also, the .Save worked a treat too, thanks
On a side note I have had a look at SDK outside of workflow, and got this partly working
RepositoryRegistration repository = new RepositoryRegistration(serverName, repoName);
using (Session session = new Session())
{
session.LogIn(username, password, repository);
// Create a document under the root folder
DocumentInfo docInfo = new DocumentInfo(session);
// add a page to the new document
FolderInfo rootFolder = Folder.GetRootFolder(session);
docInfo.Create(rootFolder, "Created By Document Builder", EntryNameOption.AutoRename);
docInfo.SetTemplate("Client Document");
FieldValueCollection fvc = new FieldValueCollection();
fvc.Add("Subject", "");
fvc.Add("Document Date", "");
fvc.Add("Description", "Testing TIFF");
fvc.Add("Document Status", "");
fvc.Add("Send to Filing", "");
fvc.Add("Route to User", "");
fvc.Add("To", "");
fvc.Add("From", "");
fvc.Add("Attachment Name", "");
fvc.Add("CC", "");
fvc.Add("Client Document Sub Type", "Review");
fvc.Add("Client Document Type", "Compliance");
fvc.Add("Client Name: Document", "Pak Trust");
fvc.Add("Expiry Date", "");
fvc.Add("Original Filename", "");
fvc.Add("Original Filepath", "");
fvc.Add("Sent Date", "");
fvc.Add("Signed", "");
fvc.Add("User", "");
fvc.Add("Version Number", "");
fvc.Add("Client ID: Document", "E1002821");
fvc.Add("Previous System Last Modified Date", "");
fvc.Add("Document Number", "");
fvc.Add("iManage Doc Type", "");
fvc.Add("iManage Client Name", "");
fvc.Add("NAV Client Identifier", "");
fvc.Add("Migration Batch Ref", "FIX TIFF");
docInfo.SetFieldValues(fvc);
docInfo.AppendPage();
The preview is working however, then metadata is not being loaded and template not being set.
Is there an order to this?