You are viewing limited content. For full access, please sign in.

Question

Question

Can I save a completed form (as pdf) to a non-Laserfiche server?

asked on June 8, 2021

We have a daily status report that is currently completed in Forms and emailed as a pdf attachment to a group of people. We now need to make the document available to all employees, but obviously do not want to take up email server space with all the pdf attachments. We have an employee website, and can make the pdf available via URL if we can save the pdf to a server location. However, I can't find anything in Forms or Workflow to automate this task. If it matters, we are running 10.4. Any ideas? 

 

Thank you!

1 0

Answer

SELECTED ANSWER
replied on June 9, 2021

Hi Shawn

I've seen the exporting of PDF files to an external drive done using the SDK script activity in Workflow.

After the PDF is generated in the repository, you would need to find it with a search or find entry to target it. I also used a Token to create the Destination path token which is used by the code below

 

Example of the script would be.

namespace WorkflowActivity.Scripting.SDKScriptElectronicDoc
{
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Data.SqlClient;
    using System.Text;
    using Laserfiche.RepositoryAccess;
    using PdfExporter;
    using Laserfiche.DocumentServices;

    /// <summary>
    /// Provides one or more methods that can be run when the workflow scripting activity is performed.
    /// </summary>
    public class Script1 : RAScriptClass102
    {
        /// <summary>
        /// This method is run when the activity is performed.
        /// </summary>
        protected override void Execute()
        {
            // Write your code here. The BoundEntryInfo property will access the entry, RASession will get the Repository Access session
            string destinationPath = GetTokenValue("Destination Path").ToString();
            DocumentInfo DI = Document.GetDocumentInfo(BoundEntryInfo.Id, RASession);
            DocumentExporter DE = new DocumentExporter();
            DE.ExportElecDoc(DI, string.Format(@"{0}\{1}.{2}",destinationPath,BoundEntryInfo.Name,DI.Extension));

        }
    }
}

 

In the SDK script you need to ensure you add PDFExporter to your references (I don't recall where I got this from)

1 0
replied on June 9, 2021

Thanks Steve, I guess we've finally reached the point in our Laserfiche utilization when we'll have to install SDK. I see lots of searches for answers on here in my future. Seriously though, I really appreciate the code and the helpful tips!

0 0
replied on June 9, 2021

Shawn,

The SDK Script Workflow activity that Steve mentioned is available on all Workflow deployments.  You do not need the Laserfiche SDK to utilize the SDK Script activity in Workflow.

1 0
replied on June 9, 2021

Thanks, that's good to know. I was able to access the activity, but can't find the pdfexporter to add to references. Anyone know where to find that and how to add it?

0 0
replied on June 9, 2021

If you aren't comfortable with coding, Qfiche also offers a document exporter workflow activity for a very reasonable price that also supports multiple formats other than PDF. http://qfiche.com/products

0 0
replied on June 9, 2021

Shawn,

It should be in the GAC.  When you add the reference in the SDK Script activity try to browse to C:\Windows\Microsoft.NET\assembly\GAC_MSIL\PdfExporter.  You might get a warning that file browsing is disabled.  In that case you have to enable file browsing in the Workflow Admin Console.  In the Workflow Admin Console drill down to the Security/File Browser Options and edit the options to enable file browsing.

Lots of hoops to jump through but once you get the references added and the  script copied then Steve's script should work for you.    

0 0
replied on June 9, 2021

PDFExporter is not part of the Workflow installation. It requires using LFSO and DocumentProcessor which are no longer used in Workflow. The script Steve pasted above uses Laserfiche.DocumentServices to export.

Laserfiche.DocumentServices is part of the Workflow installation and you can find it in the GAC. Follow Cliff's instructions above and make sure to match the version of DocumentServices you reference to the version of Laserfiche.RepositoryAccess referenced in the script (which would be the same as the version of your Workflow installation)

0 0

Replies

replied on June 8, 2021

Hey Shawn,

This may sound not all the way thought out, but wanted to throw it out there..... could you have Workflow send the status report pdf to a single email address and have the email application automatically save the attachment to the drive?  I found an old post that talks about something like that.

https://community.spiceworks.com/topic/94566-auto-move-attachment-from-outlook-message-to-network-drive

This may be no help at all, but wanted to share the idea.  Just brainstorming alone here in Idaho.

No laughing!

Christine

1 0
replied on June 9, 2021

This is a really creative workaround! We already have Forms sending the report as a pdf via email, so that part would be easy and wouldn't even need Workflow. Since we don't have SDK installed currently (for the script suggested below), I'm going to have our IT team look at whether this would work. Thank you!!

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.