cancel
Showing results for 
Search instead for 
Did you mean: 

Displaying PDF in HTML container

Former Member
0 Kudos

Hi,

I have requirement PDF function (PDF interface is dictionary based ) should be called in a loop and final all pages should dispaly in HTML container or BSP pages.

I have tried by calling the PDF in a loop and appended the PDF string fpformoutput-pdf to a field ( <b>pdfresult type XSTRING</b>) . Though the final string is showing total length of all appended PDF strings , in the output the last appended PDF only displayed.

I have used the following code to display the PDF in HTML container, but only last page is coming for diaplay.

l_len = XSTRLEN( pdfresult ).

WHILE l_len >= 1000.

l_pdf_line = pdfresult+l_offset(1000).

APPEND l_pdf_line TO l_pdf_data.

ADD 1000 TO l_offset.

SUBTRACT 1000 FROM l_len.

ENDWHILE.

IF l_len > 0.

l_pdf_line = pdfresult+l_offset(l_len).

APPEND l_pdf_line TO l_pdf_data.

ENDIF.

CALL METHOD pdf_html_control->load_data

EXPORTING

url = 'smart.pdf'

size = pdf_size

type = 'application'

subtype = 'pdf'

IMPORTING

assigned_url = l_url

CHANGING

data_table = l_pdf_data

EXCEPTIONS

OTHERS = 1.

Please let me know how should proceed to solve the problem.

Thanks and Regards,

Pavan Meda

Accepted Solutions (0)

Answers (1)

Answers (1)

markus_meisl
Active Contributor
0 Kudos

Without going into too much detail, here's some information from development:

As the Internet Explorer plug-in of Adobe Reader is not able to display all PDF files at a time, you cannot append all your PDFs and will need to keep them in a table, and create some kind of button navigation to switch from one PDF to the next and/or back.

The load_data data provider also has a limitation in that it caches information. So if all your PDFs are called smart.pdf, you can try to navigate to the next and the one after, but will always see the first one. So: You'll need to give each file a separate name, e.g. smart1, smart2,...

For more information, see Include LFPCOMPPRV on the print preview.

According to development, this is something consultants spend hours on...

Kind regards,

Markus Meisl

SAP NetWeaver Product Management