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

Question

Question

Adding a PDF to an existing document

asked on March 11, 2014

 Hello.

 

I'm a Workflow newbie, so this is going to be my very first workflow. :)

We have a system already in place that processes our Vendor Invoices. The operators scan the Invoice in as it comes from the vendor, then they fill out some metadata fields and the Workflow does its magic to move the invoices through myriad of folders and eventually into the processed folder.

 

I need to associate a PDF with these documents. Basically, as we cut a check for each invoice, in our main system, we generate the check image as a PDF. These PDFs are then stored in a folder on a drive on some server or other. I want to programmatically associate this PDF with the Invoice.

 

I'm wondering if it is possible to append the PDF to the bottom of the scanned Invoice image, and if it is what are the Actions to accomplish that?

 

If it isn't possible I'd like to create at least a hyperlink to the PDF files in the metadata section of each Invoice document.

 

I think my flow would be something like:

1. Loop through the folder containing the PDFs (I was unable to find this Action)

2. Generate the PDF as a LF document (Also am not sure how to do that)

3. Append the LF document to the existing Invoice document, after the last page of the Invoice (Possibly using the Attach Electronic Document action?)

 

Thank you in advance for any and all help.

Rudy

0 0

Replies

replied on March 11, 2014

It seems to me that Quick Fields would be a much better tool for this. Workflow does not do image processing or generate images from PDFs, with Quick Fields you can scan the PDF and append it to the invoice it is associated with (likely with a lookup).

 

1) If you want to take the URL route to loop through a folder you would use a "For Each Entry" activity on the entries you make available with a Find Entries pointed at that folder.

 

2) Workflow cannot out of the box generate pages for an electronic document. You could script this, but it is not recommended.

 

3) You would use a "Move Pages" activity to append the pages, but you need those to already exist (you could scan them into Laserfiche separately and find them with Workflow to move the page). Attach Electronic Document works to attach e-docs to a Laserfiche doc, which is separate from dealing with pages.

 

Hopefully some of this helps.

2 0
replied on March 12, 2014

Hi Matt.

 

Thank you very much for your reply. It is indeed very helpful.

1. I do not have Quick Fields licensed for this project, so ideally I'd like to do this with Workflow. If it proves to be not doable then I can sit down with the rest of the team and decide if we'd like to purchase the Quick Fields functionality for this.

 

2. OK. So this makes a lot of sense. Since a PDF is not an image it cannot be appended to bottom of the pages which as it turns out must be image files only. However, this need not be the only way of importing this new document into an existing one. As I mentioned even something as simple as a hyperlink would work. But if I can add it as an attachment that would definitely work, and be preferable to a hyperlink. If you have additional hints or instructions on this, I'd love to hear them.

 

Rudy

 

P.S. For some strange reason I was not notified of all these replies even though I subscribed to this post. :(

0 0
replied on March 12, 2014 Show version history

To respond to your note about subscriptions:

 

All of these answers were posted fairly recently, so the notification may not yet have sent. Change your frequency settings for Answers notifications if you want to be notified more immediately.  In the upper right corner of answers, your name should appear with a down arrow next to it. Click there to bring up the menu, and select "Settings". Scroll down to the Email Notifications section, and make sure you have the settings you want for the frequency of notifications:

 

Note that Answers allows you to have a separate frequency for questions you've asked vs. questions you've just subscribed to.

1 0
replied on March 12, 2014 Show version history

Thank you Brianna. Realizing that I did not receive the notifications got me looking for these options and changing them to receive the notifications sooner. Although it still didn't work for your reply. :) Since I made the changes before you replied. :) Oh well, I'll just make sure to check back frequently, now that I know.

 

Thanks

Rudy

 

EDIT 03/13/2014 - It's been at least 24 hours since I updated my settings to notify me every 15 minutes if there's a post or reply in this thread, and I still have not received a single notification. :) Just an FYI Brianna.

0 0
replied on March 12, 2014

Workflow is not ideal for this kind of usecase. Workflow can attach a PDF to a document, but it can only get that PDF from on the workflow server, which would not make sense for this.

 

If you don't go the Quick Fields route you can just import the PDFs to Laserfiche (which can generate the pages) and have a Workflow then move that generated page to the document you want.

 

Regardless of whether you are trying to use hyperlinks or add the pages, you need a way to capture the PDF and put it in Laserfiche, and Workflow is not a capture tool.

1 0
replied on March 12, 2014

Thank you Matt.

 

Rudy

0 0
replied on March 12, 2014

Hi Rudy,

 

In practice, I've found the best way to do this is use similar metadata to tie them together, like an invoice number. This could be achieved without code and by using a combination of Import Agent and Workflow

 

Other options are:

  • Set the PDF as an electronic rendition of the invoice but this is misleading as it's not a rendition
  • Use "links" between the documents but this requires the user to open the metadata form, click onto the Liinks tab and follow the links. It's great for defining document relationships but not as quick as simply searching for an invoice number and finding  both the invoice and the check image in one step.

 

Just my 2c. Hope that helps.

 

-Ben

1 0
replied on March 12, 2014

Hi Ben.

 

Thank you very much for your reply. I've never heard of the Import Agent before, so I'm happy you mentioned it. I don't see it anywhere in our Laserfiche installation so I'm guessing it's a separately licensed product. I'll start asking around about it though.

 

There really isn't a need to find both the Invoice and the check documents in a single search, unless I am left with the hyperlink as the only option.

 

I'd prefer that they were a single document, that single document being the Invoice. If I could attach the Check as a PDF to the Invoice document that would work great, depending on how attachments look like. :) But if the users could open and see the checks after opening and looking at the Invoice that would work exactly like we want at the moment.

 

Rudy

 

0 0
replied on March 12, 2014

Import Agent will import the PDF for you, but it also will not generate Laserfiche Pages for them, so you still will not be able to combine them into a single document.

1 0
replied on March 13, 2014

I see, so Quick Fields is the only way to get a PDF into "Pages" that can be added to the existing document.

 

Can a PDF be simply attached to the existing document? Without doing any processing or parsing of the PDF?

 

Rudy

0 0
replied on March 13, 2014 Show version history

The client can also generate pages for a PDF on import.

You could also make it an annotation attachment on a document, double clicking the annotation would open the PDF.

 

If you wanted to get complicated, you could import the document as an edoc, use the Workflow activity "Download Electronic Document" then attach the output of that document to the original document. 

What this would do is associate the E-doc with the LF document. Right clicking the document would then give you the option to open the electronic document (check) or the Laserfiche Pages, but these options really seem like avoiding the most intuitive way of doing things.

1 0
replied on March 13, 2014

I agree with you. Plus the idea is to do this completely in the background with no user intervention.

 

Rudy

0 0
replied on March 12, 2014

I'd agree with Matt on Quick Fields. 

 

The following would hinge on the PDF documents being named the invoice number or something else that is unique and that is on the already existing invoice documentation in Laserfiche.

 

1.  Use Universal Capture Engine in Quick Fields to grab the PDF's out of your folder.  This can convert them to tiff.

2.  The Quick Fields session would be set to keep their same name (invoice number) and send them to a generic "incoming invoices " folder.

3.  Workflow would monitor this folder for document creation (trigger).

4.  The workflow would simply read the document name (invoice number) and then run a Search Repository.  Search for the invoice number (document name).  I am not sure how your existing invoices in Laserfiche are laid out but I am assuming that they are named the invoice number or have the invoice number in the metadata.  Build your search appropriately.

5.  Your search should return the existing invoice information document.

6.  Use the Move Pages to append the document to the end of the existing document (the search result).

1 0
replied on March 12, 2014

Hi Chris.

 

Thank you for your reply. It is really helping me to put the pieces of the puzzle together. As I mentioned I do not have Quick Fields licensed so at least for now have to make do with what I have. (Not my decision :))

 

My check files do indeed contain the Invoice number in the File Name, along with some other text. So I'll have to figure out how to extract the Invoice Number from that text within Workflow.

 

I will only be operating on Invoices that have been fully processed by our existing system. These Invoices are moved into a folder within the repository called Invoices. Within that folder the next granularity level is the year. One folder for 2012, 2013 and 2014 each. Within each year it is Alphabetically organized One folder for A-F, another for G-L, then M-R and finally S-Z.

Seeing this organization do you still think it would be better to use action Search Repository as opposed to something like For Each Entry?

 

Thanks

Rudy

0 0
replied on March 12, 2014

How are the existing documents stored as far as their name?  Consider the following for example.

 

Invoices

     2014

          A-F

          ....

          S-Z

               Test Company

                    Invoice 1234

                    Invoice 1235

 

Is this how things are?  If they are not named the invoice number do you have templates on them that contain that information?  Basically you have to something on the existing document in Laserfiche that matches what you have in your PDF name.

 

If you do not have Quick Fields something simple you could do is to make your Workflow a Business Process.  This allows you to simply kick off the Workflow on whichever document you want.

 

Workflow:

 

1.  Pattern Match the invoice number off the document name.

2.  Run a search in Laserfiche for that invoice number.  Again this assumes that the documents you have in Laserfiche already contain that invoice number in the name or metadata.  You will do a Search Repository activity.

3.  The return results should be only one as the entry is unique (not sure but it should be).

4.  Then use the Move Entry activity to append it to the search result.

 

 

Starting the Workflow.

 

1.  Drag and drop the PDF's into Laserfiche.  You said they have the invoice number in the name along with other things.

2.  Select them all, generate their pages, then delete the electronic files (converting them all to tiff).  You can set your import options in the client to do this automatically on import if you wish.

3.  Then you can select them all, right-click Start Business Process, and select the Workflow.

 

Since you are running the Workflow on all documents each will kick through the Workflow one at a time.

 

2 0
replied on March 13, 2014

Hi Chris.

 

Thank you once again for the reply and your time. I truly appreciate it.

You got the directory structure within Laserfiche strangely perfect. :O :)
2014
A-F
Vendor named AAA Widgets
AAA Widgets_123456

This last line is the name of the document. To the left of the underscore is the Vendor Name and to the right is the Invoice Number.
However both of these are available as metadata on each and every document, so it may not be that crucial that they are also used in the name.
So to answer your question on the templates yes, this info is indeed there.

 

Here's the sample name of the PDF:
MQ Payment Advice - Your Invoice 0012345678.pdf

 

As far as the business process behind this here it is: Every Tuesday my Accounting department runs a process that generates payments to the vendors.
Once this process is complete a folder on the disk drive of the server where this program runs will be populated with PDF outputs of these payments.
Basically checks. There could be dozens, hundreds and maybe even over a thousand of these. So naturally I'd like to do all of the processing with no humanoid intervention. Note these PDFs at the moment are not even on the same server that Laserfiche runs on. However, if Laserfiche cannot read/process remote files I'll have to devise a separate process to have them copied to a server that Laserfiche is running on.

 

My Workflow logic would go something like this:
1. For each PDF file in the directory of the remote server. (Find Entries -> For Each Entry)
2. Extract the Invoice number from the name of the PDF file. (Pattern Match)
3. Find the Invoice in the Repository (Search Repository)
4. If found (Routing Decision? Branch 1)
5. Attach the PDF to the found document (Attach Electronic Document)
6. Else (Routing Decision? Branch 2)
7. Send email to the president (E-mail)

 

Does this look reasonable and/or correct?

Rudy

0 0
replied on March 14, 2014

Yes, that looks fine to me.  Users will just need to know to check the attachments since they are two different file types.  The only other thing you could inquire about is if your finance system can kick out tiffs instead of PDF's.  If it can then you can basically do the same thing but add them right to the existing pages instead of as an attachment.  

1 0
replied on March 17, 2014

Hi Chris.

 

Thanks again for the reply. I definitely plan to float the question of TIFFs instead of PDFs out there. Although I think it's unlikely to be possible. The back end system producing these is SAP.

 

In any case as a noob I have some questions related to the above workflow that I proposed.

 

1. In the Pattern Matching Action I need the name of the PDF file that the For Each Step Action is processing. I'm using the token %(ForEachEntry_CurrentEntry_Name) thinking that the name of the file will be in it. Is this correct?

 

2. The PDF files I'm using at the moment are created on the QA server. Once I move this workflow to production I will need a different folder specification in the Find Entries Activity. Is there a way to avoid hard coding that or do I have to edit that manually every time I move my workflow from QA to Production?

 

3. I'm on Workflow version 8.3 and I don't see a way to run/test my Workflow in the Workflow Designer. Am I missing something?

 

4. I opened an existing invoice in my QA/Test environment in Laserfiche Client and added an Attachment to it manually just to see what it would look like. The Add was done through the menu option Annotations ->Attachments. However after I attached the PDF i could no tlocate it anywhere in the document. Not even when I looked in the Annotations Pane. How do I Attach PDF documents to existing Invoice document, and how can check to see what it looks like?

 

TIA
Rudy

0 0
replied on March 13, 2014

Hi Chris.

 

Thank you once again for the reply and your time. I truly appreciate it.

You got the directory structure within Laserfiche strangely perfect. :O :)
2014
   A-F
      Vendor named AAA Widgets
         AAA Widgets_123456

This last line is the name of the document. To the left of the underscore is the Vendor Name and to the right is the Invoice Number.
However both of these are available as metadata on each and every document, so it may not be that crucial that they are also used in the name.
So to answer your question on the templates yes, this info is indeed there.

 

Here's the sample name of the PDF:
MQ Payment Advice - Your Invoice 0012345678.pdf

 

As far as the business process behind this here it is: Every Tuesday my Accounting department runs a process that generates payments to the vendors.
Once this process is complete a folder on the disk drive of the server where this program runs will be populated with PDF outputs of these payments.
Basically checks. There could be dozens, hundreds and maybe even over a thousand of these. So naturally I'd like to do all of the processing with no humanoid intervention. Note these PDFs at the moment are not even on the same server that Laserfiche runs on. However, if Laserfiche cannot read/process remote files I'll have to devise a separate process to have them copied to a server that Laserfiche is running on.

 

My Workflow logic would go something like this:
1. For each PDF file in the directory of the remote server. (Find Entries -> For Each Entry)
2. Extract the Invoice number from the name of the PDF file. (Pattern Match)
3. Find the Invoice in the Repository (Search Repository)
4. If found (Routing Decision? Branch 1)
5. Attach the PDF to the found document (Attach Electronic Document)
6. Else (Routing Decision? Branch 2)
7. Send email to the president (E-mail)

 

Does this look reasonable and/or correct?

Rudy

You are not allowed to follow up in this post.

Sign in to reply to this post.