Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

combining pdf have issues

Avatar

Level 4

Hi all,

I need to combine pdf's using invoke DDX.

I tried it but I did't get the result.

Can anyone tell me how to combine pdf.

Here is the DDX details

<?xml version="1.0" encoding="UTF-8"?>
<DDX xmlns="http://ns.adobe.com/DDX/1.0/">
    <PDF result="out.pdf">
        <PDF source="in1.pdf"/>
        <PDF source="in1.pdf"/>
    </PDF>
</DDX>

When I place the 2 pdfs in Input folder, the result was the same 2pdf's.

Shaji

1 Accepted Solution

Avatar

Correct answer by
Level 8

When you use an input folder containing multiple files, and you don't know how many files there will be, use a List of Documents as the input variable.  That way you get all of the documents from the input folder in one data structure.

The nice thing about this is that you can use Assembler to map the entire list to a single PDF source object in the DDX.

<?xml version="1.0" encoding="UTF-8"?>
<DDX xmlns="http://ns.adobe.com/DDX/1.0/" >
    <PDF result="out.pdf">
        <PDF source="inList"/>
    </PDF>
</DDX>

In this case I created a single input variable, of type List/Document, called inDocList.  For the watched folder this is mapped to a variable with *.* as the pattern.  This means that when I drop a folder containing any number of files, they will go into my inDocList object.

The DDX has a single PDF source called inList.  My invoke DDX step mapps the inList to the inDocList variable.  When Assembler sees that it will perform the stated operation (in this case combine the documents) over each document in the list.

The nice thing about doing it this way is that I don't need to keep track of how many documents a user drops into the watch folder.  It could be 5 or 15, the operation will still work.

I've attached an LC ES 8.2 process LCA as an example.

BTW - here are some shots of the LC ES 8.2 watch folder setup:

watchTop.png

watchBtm.png

View solution in original post

6 Replies

Avatar

Level 8

You have 2 issues:

1 - both your source references are the same.  They need to be unique. Try  <PDF source="in1.pdf"/> <PDF source="in2.pdf"/>

2 - The issue isn't just DDX, its the way you are calling the process.  When you use a watch folder, every file/folder that gets dropped in is treated as a seperate request. This is because a watch folder can be shared by many people or systems.  If I drop 3 files in and you drop 4, how will the system be able to tell what documents go with what request?

Fortunately the solution is quite simple.  Combine all of the files for a single request into a folder.  Then drop that folder into the watch folder directory.  Everything under that folder will be considered a single request.

In your case, put both PDFs into a single folder (it doesn't matter the name), then drop that folder into the watched folder.

Avatar

Level 4

Thanks for the response,

I will check and get back to you.

Shaji

Avatar

Level 4

HI Hodmi,

I am on leave for a week.

Still I have issue in combining the pdf.

Please see my screenshot.

As said I have changed the in1.pdf to in2.pdf but this goes to "stage" i am not getting the result.

When I use the in1.pdf its working, but I have issues.

I crated a directory and placed 4 pdfs, then I copied the directory in to the "input" watchfolder.

I got the output in "result" folder, the problem with the result is the first pdf combined 2 times and the rest 3 pdf's were skipped was not combined.

What will be the issue.

<?xml version="1.0" encoding="UTF-8"?>
<DDX xmlns="http://ns.adobe.com/DDX/1.0/" >
    <PDF result="out.pdf">
        <PDF source="in1.pdf"/>
        <PDF source="in1.pdf"/>
    </PDF>
</DDX>

Please advice.

Avatar

Correct answer by
Level 8

When you use an input folder containing multiple files, and you don't know how many files there will be, use a List of Documents as the input variable.  That way you get all of the documents from the input folder in one data structure.

The nice thing about this is that you can use Assembler to map the entire list to a single PDF source object in the DDX.

<?xml version="1.0" encoding="UTF-8"?>
<DDX xmlns="http://ns.adobe.com/DDX/1.0/" >
    <PDF result="out.pdf">
        <PDF source="inList"/>
    </PDF>
</DDX>

In this case I created a single input variable, of type List/Document, called inDocList.  For the watched folder this is mapped to a variable with *.* as the pattern.  This means that when I drop a folder containing any number of files, they will go into my inDocList object.

The DDX has a single PDF source called inList.  My invoke DDX step mapps the inList to the inDocList variable.  When Assembler sees that it will perform the stated operation (in this case combine the documents) over each document in the list.

The nice thing about doing it this way is that I don't need to keep track of how many documents a user drops into the watch folder.  It could be 5 or 15, the operation will still work.

I've attached an LC ES 8.2 process LCA as an example.

BTW - here are some shots of the LC ES 8.2 watch folder setup:

watchTop.png

watchBtm.png

Avatar

Level 4

Hi Hodmi,

Thanks its working fine now.

I have one more question of importing the .lca files.

Since livecycle were eating much of space we have deleted some of the folders in DocumentStorage.

Because of this I am not able to import the .lca files.

See the scrrenshot.

The combining pdf's watchfolder was configured as per your instruction and working fine.

How do I overcome this error so that I can import the .lca files in future.

Please advice.

This topic was posted in this forum but no one replied yet.

It will be much appreciated if I have any advice from your side to overcome this issue.

I will post my next process as separate discussion, "splitting pdf".

Shaji