Complicated PDF Merge

Post Reply
major
Newbie
Posts: 8
Joined: Mon May 22, 2017 9:17 am

Complicated PDF Merge

Post 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
NEOSA
Member
Posts: 40
Joined: Thu Mar 10, 2016 6:31 pm

Re: Complicated PDF Merge

Post 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.
major
Newbie
Posts: 8
Joined: Mon May 22, 2017 9:17 am

Re: Complicated PDF Merge

Post 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.
NEOSA
Member
Posts: 40
Joined: Thu Mar 10, 2016 6:31 pm

Re: Complicated PDF Merge

Post 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
major
Newbie
Posts: 8
Joined: Mon May 22, 2017 9:17 am

Re: Complicated PDF Merge

Post by major »

Thanks for reply, I will try.
major
Newbie
Posts: 8
Joined: Mon May 22, 2017 9:17 am

Re: Complicated PDF Merge

Post by major »

Thank You, this is the right way to solve my problem. :D
Post Reply