Page 1 of 1

Complicated PDF Merge

Posted: Tue May 23, 2017 10:48 am
by major
Hello,
I'm working on a flow where there are several groups of PDF files uploaded to one folder.
The file names in each group start with two identical characters and end with a page number. The number of files in groups varies, the number of groups can also be changed:

AA_170523_01.pdf
AA_170523_02.pdf
AA_170523_03.pdf
AA_170523_04.pdf
...
AA_170523_15.pdf

BB_170523_01.pdf
BB_170523_02.pdf
...
BB_170523_10.pdf

...

XY_170523_01.pdf
XY_170523_02.pdf
...
XY_170523_09.pdf

The files in each group should be assembled for a PDF Merge, and the merged pdf name should be the first 9 characters of the file names in the group.

I created a basic flow for one such group with success.

My questions are:
1. Can this process be implemented in one flow or is it better to duplicate flow for each group?
2. Is it possible to name the merged pdf file with the first 9 characters from the input filename?

I don't have much experience in Switch. Any help will be appreciated.

Major

Re: Complicated PDF Merge

Posted: Thu Jun 01, 2017 3:31 pm
by NEOSA
Hi major,

How your incoming files arrives ?

Does the HotFolder receiving files "see" all the files at the same time, ie all AA_*.pdf are copied in a single shoot ?

Or do you specify a timer with an "Assemble Jobs" ?

Thanks for reply.

Re: Complicated PDF Merge

Posted: Tue Jun 06, 2017 9:54 am
by major
Hi,
files are copied at once; input hotfolder has default 10 sec scan timeout; assemble job has timeout 2 minutes.
Thanks for Your reply.

Re: Complicated PDF Merge

Posted: Wed Jun 07, 2017 4:10 pm
by NEOSA
Hi major,

OK, you need to use a regular expression fo filter jobs by its name.

First, you store in a JobState the name (Folder01) with this setup :

[Job.NameProper:Search="([A-Z])\1_([0-9]{6})"]

You setup the tool AssembleJob with a custom setting :

Job Identifier : [Job.NameProper:Search="([A-Z])\1"]
Number of files : 100 (or greater if you copy hundreds of files at the same time
After N minutes : 1 or more
Complete condition : None


Then, MergePDF and Rename with :

Replace on Filename Proper, by [Job.JobState] (stored in Folder01)

You can also just after the INCOMING_FOLDER filter with a RegEx to move in a ERROR_FOLDER if files don't match AA_* or so on.

Have fun ;-)

Image

Re: Complicated PDF Merge

Posted: Fri Jun 09, 2017 9:43 am
by major
Thanks for reply, I will try.

Re: Complicated PDF Merge

Posted: Tue Jun 13, 2017 2:22 pm
by major
Thank You, this is the right way to solve my problem. :D