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
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
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
As of Workflow 9.1, Page Count is available as an entry property in the Find Entry, Find Entries and Search Repository activity.
It works great! Thank you!!!
Find Entry |
Finds the entry with the ID: %(Entry ID) |
Assign Token Values - Page Count |
Create the following tokens: |
Repeat |
If all of these conditions are true |
Apply Stamp - Void |
Entry: Starting Entry |
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.
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.
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!
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?
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.
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!
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).
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.