cancel
Showing results for 
Search instead for 
Did you mean: 

How to show two or more PDF in one PDF-Reader / Concatenate PDF-Files

jrgen_bauer
Explorer
0 Kudos

Hi,

I want to show two or more PDF files in one PDF reader window or to concatenate two or mor PDF files to one file.

We use WD4A and ADS.

Have someone an idea to solve this without an external program?

Thx in advance

Jürgen

Accepted Solutions (0)

Answers (2)

Answers (2)

OttoGold
Active Contributor
0 Kudos

When you need to combine more PDF files into a single one:

But that is with external program. As far as I know this cannot be done in SAP/ ADS. If that is urgetnt need, you will have to create a form and copy all the "to-be-merged" forms into this single one.

Regards, Otto

Former Member
0 Kudos

We have done this successfully a few times using WDA - it wasn't easy - it took us 2 full weeks to figure it out, so i need to get full points for this one!

It's going to much easier to do this if you start a brand new WDA. If not, you'll have to re-do all your Context Node navigations within your methods.

The first thing you need to do is to define your Context properly:

You need a top level Node defined as 1:1 cardinality (as with all PDF development)

Next, you need another Container Node 1:n cardinality (this holds the collection of content nodes)

Finally, you have your PDF Content Node 1:n cardinality - This holds each instance of your PDF form

In our scenario, we are passed in a list of Project Numbers. We need to generate a PDF sheet for each project in the same PDF session.

pseudo code - i'm leaving out some of the unnessary details


Loop through the project number table.

ADD 1 TO v_cnt.

* navigate from <TOP> to <PDF_CONTAINER> via lead selection
    lo_nd_pdf_container = lo_nd_top->get_child_node( name = wd_this->wdctx_pdf_container ).

* This is the Important Part - we check to see if there is an element where index = v_cnt
* If not, we create one where we can store the new set of data
* get element via lead selection
    lo_el_pdf_container = lo_nd_pdf_container->get_element( index = v_cnt ).
    IF lo_el_pdf_container IS INITIAL.
      lo_el_pdf_container  = lo_nd_pdf_container->create_element( ).
      lo_nd_pdf_container->bind_element( new_item = lo_el_pdf_container
                                           set_initial_elements = ' '   ).
    ENDIF.

    lo_nd_ideasheet_data =  lo_el_pdf_container->get_child_node( 'IDEASHEET_DATA' ).

    lo_el_ideasheet_data = lo_nd_ideasheet_data->get_element( index = 1 ).

* fill all the data then bind the structure
Select * from XXX into lt_XXX
  where project_number = lt_project-project_number.

* Move Data to appropriate fields/tables


* Bind the info back to the element
    lo_el_ideasheet_data->set_static_attributes( static_attributes =
                                              ls_ideasheet_data ).


Endloop.

OttoGold
Active Contributor
0 Kudos

Robert, I have some questions. I cannot see the magic in your coding, that probably because I am not that good in WD. But:

a) I though we are talking about different form templates. Like to combine ZFORM1 template and its form and ZFORM2.

b) How do you (my lack of WD knowledge probably) ...using WD application... send the forms through email?

I guess some more question will arise to let us ordinary people see the magic within.

Regards, Otto

Former Member
0 Kudos

Otto,

I was answering the original question about showing 2 or more PDFs in one PDF - or how to concatenate multiple PDFs into 1. I think someone else wanted to know how to email the PDF.

I assumed he wanted to generate 1 form many times with different information - such as a W2 tax form for 100 employees.

By creating a new element in the node for each employee's information, you can pass the entire Node to the ADS and it will generate 100 different pages of the tax document in your Adobe reader.

Previously, we could only generate 1 form at a time.

EDIT: I was re-reading the original post, and assumed that he wanted multiple versions of the same PDF in 1 reader instance - that's what we were able to figure out. We haven't tried to merge multiple differing PDFs into 1.

I'm wondering on the possibility of merging 2 separate forms into 1 combined form - let us say a Technical Spec and a Functional Spec.

Maybe you could create a brand new form having 2 pages - both the Technical and Functional Specs. You could perhaps select the data from the originals into and pass that data to your newly created forms.

Edited by: robert phelan on Feb 17, 2010 10:22 PM

Former Member
0 Kudos

Hello Jurgen

Have you found a solution?

We have several spool containing several PDF form.

I need to combine "Merge/Concatenate" those PDF into one prior to send it by email.

Using external program can not be an avenue because our application server is not a windows one.

any suggestion would be highly appreciated.

Regards

dstj

Former Member
0 Kudos

Hi,

For sending by mail several PDF merge into one, the best way to do it is to open one spool only and put all result inot it ...that work's fine .

Try this.

Regards