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

Question

Question

Page Count in Workflow

asked on May 15, 2013 Show version history

Is there a way to find out how many pages there are in a document? I am trying to apply a stamp to all of the pages of a document.

 

--

Thanks

2 0

Answer

APPROVED ANSWER
replied on July 3, 2013

Could that be memory intensive if counting the pages of a large document?

I would probably use a tookkit script to update a token, even though it makes the workflow a level of complexity higher to maintain.

    Public Class Script1
        Inherits SDKScriptClass90
        '''<summary>
        '''This method is run when the activity is performed.
        '''</summary>
        Protected Overrides Sub Execute()
            if me.Entry.EntryType=Entry_Type.ENTRY_TYPE_DOCUMENT Then
                dim DocObject as LFDocument=me.Entry
                dim PageCount as Integer = DocObject.PageCount
                
                SetTokenValue("Page_Count_Token",PageCount)
             end if
        End Sub
    End Class

 

2 0

Replies

replied on February 19, 2014

As of Workflow 9.1, Page Count is available as an entry property in the Find Entry, Find Entries and Search Repository activity.

3 0
replied on April 25, 2014

It works great!  Thank you!!!

 

Find Entry

Finds the entry with the ID: %(Entry ID)
Additional Properties:
• Page Count

Assign Token Values - Page Count

Create the following tokens:
• %(Page Count) = %(FindEntry_OutputEntry_PageCount)

Repeat

If all of these conditions are true
       %(Repeat_Iteration) is less than or equal to %(Page Count)
• Limit repetitions to: 100
• Evaluate condition before running contained activities
• Start the Iteration token at 1

Apply Stamp - Void

Entry: Starting Entry
Page: %(Repeat_Iteration)
Position: Top/Center
Name: Void
Opacity: 100
Rotation: 0
Color: Red

2 0
replied on May 22, 2013 Show version history

In Workflow 9 you can use the Retrieve Document Text activity which gives you the ability to create a separate value for each page which is stored as a token.

 

 

Once that is done there is another quick step in order to have this token working properly. When using that token, be sure to right click and go to the token editor and apply the Value Count function to the token. This will allow the token to be replaced with a number that corresponds to the number of pages in the document.

 

1 0
replied on July 26, 2013

Yes, retrieving the whole document text to count pages is very inefficient both on the LF Server and on the WF Server side. The script is a much better alternative.

0 0
replied on April 24, 2014

Can anyone explain how to use the Find Entry activity to obtain the page count and use it in the Apply Stamp activity to specify the page numbers to which the stamp will be applied?

 

The workflow I'm working on will add a stamp to any document that enters a specified folder.

 

Thank you!

0 0
replied on April 24, 2014

Apply Stamp does not currently support dynamic stamps in Workflow, you can only apply image stamps.

 

What is the purpose of stamping the page count on it?

0 0
replied on April 24, 2014 Show version history

In Workflow 9.1 there are "Additional Properties" you can retrieve for documents using find entry. (See below)

You would then use a conditional sequence based on the page count token being greater than or equal to 1 and use the apply stamp activity to set the stamp if the condition is true.

 

 

Edit: misread about the dynamic stamp part, workflow does not do that. You would need to use Quick Fields to do that.

2 0
replied on April 24, 2014

Oh no, I didn't want to stamp the page number on each page.  I want to add an image stamp to all pages.  Thanks!

0 0
replied on April 25, 2014

That you can definitely do. Use a Repeat activity with a condition on the iteration token being less than or equal to the page count. Inside the Repeat, you can use an Apply Stamp activity and set the page using the %(Repeat_Iteration) token (it may not show up in the token list, but it will be listed if you open the Token dialog).

4 0
replied on August 22, 2017

I know this post is a bit old but Matt do we still need Quick Fields to stamp page numbers on documents.

 

i.e. I have a form that gets filled out in Forms and then when it's saved to the repository there are WFs that kick off to take the form data and put it in a fillable PDF. Then that gets saved as a TIFF. Then if there are images attached to the form those are converted to TIFFs as well. All of those are combined into one entry and then a PDF is made.

So the final entry has a PDF and the TIFFs. However, I would like to have the page numbers stamped on the bottom of each page for however many pages there are.

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

Sign in to reply to this post.