Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Displaying PDF in HTML container

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

Former Member
Not what you were looking for? View more on this topic or Ask a question