Skip to Content

Download Multiple Page PDF (From Adobe Form)


I have developed an Adobe from for a countries tax certificates. All the employees certificates needs to be in 1 PDF.

When you do a print preview, everything looks 100% and you can see page 1, 2 etc etc.

The problems is when I try do download this, it seems almost impossible. I have read everything that I could find on the forums but none of the solutions work:

1) My first option would be to use the logic as described in FP_CHECK_BATCH_PDF_RETURN. The problem when you use function 'FP_GET_PDF_TABLE' you end up with two XSTRING rows. I tried to convert this to Binary by using the following:

buffer = ls_pdf
append_to_table = 'X'
output_length = lv_filelength
binary_tab = lt_pdf_content.

DESCRIBE TABLE lt_pdf_content LINES lin.

lv_filelength = lin * sy-tleng .

And then download the binary by either using GUI_DOWNLOAD or OPEN DATASET lv_file FOR OUTPUT IN BINARY MODE MESSAGE lv_msg but keep on getting a message that the PDF file has been damaged and cannot be repaired.

If I add only 1 page, it works. If I add the whole binary table (multiple pages), with the field length the same as 1 page.. to works. How do I get multiple XSTRING to convert correctly into binary so that it downloads correctly??

2) I have tried Function FPCOMP_CREATE_PDF_FROM_SPOOL but it only returns 1 page at a time, which leaves me again with a fustrating sinlge XSTRING again.

3) RSTXPDFT4 does not work

4) I don't want to install a third party tool. I surely must be possible to do it in ABAP.

Any suggestions or solutions would be appreciated. Someone must have done this before?

Kind Regards


Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Jan 05, 2017 at 01:33 PM

    To whom ever have the same problem...

    I could not find a way to covert multiple xstrings into 1 binary and get it to download correctly.

    I was however able to get the single pdf working with another solution. I changed the logic of my adobe form to use my whole internal table with employees and create a new page for each row entry in my table. You basically add the internal table to your interface and context. You then link your table row to your main subform that is used in your Main Content Area and tick 'Repeat Subform for each Data Item' and tick this as well in your table (if you have one... I created my form display structure as a table). It will then create a certificate for each employee within a single form, and when you exit the function module, you will have 1 xstring containing all the data which you then convert to binary and download.. and tadaaaa :) happy client :)


    Add comment
    10|10000 characters needed characters exceeded