Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Display PDF from internal table

Former Member
0 Likes
3,846

Hello!

Is it possible to display a PDF contained in an internal table on an Enjoy control? I saw a component CL_GUI_PDFVIEWER, but it looks like it was ment only to display a PDF file stored on a workstation (or app server, whatever).

I know: I could download an internal table to a PDF file and then use CL_GUI_PDFVIEWER. However, I'd like to skip the file and do it directly.

Is there a way?

Thanks!

Kind regards,

Igor Barbaric

Hello!

Is it possible to display a PDF contained in an internal table on an Enjoy control? I saw a component CL_GUI_PDFVIEWER, but it looks like it was ment only to display a PDF file stored on a workstation (or app server, whatever).

I know: I could download an internal table to a PDF file and then use CL_GUI_PDFVIEWER. However, I'd like to skip the file and do it directly.

Is there a way?

Thanks!

Kind regards,

Igor Barbaric

5 REPLIES 5
Read only

Former Member
0 Likes
2,521

Hi Igor

I have the same problem. Do you have the solution.

I hope you can help me.

Kind regards

Per Larsen

Read only

Former Member
0 Likes
2,521

Hi igor,

1. Not sure, but may be this FM can help HR_IT_DISPLAY_WITH_PDF.

2. It expects the data to be OTF internal table format.

regards,

amit m.

Read only

Former Member
0 Likes
2,521

Hi Igor,

we use the function module SSFCOMP_PDF_PREVIEW to display a PDF preview. The input is the OTF stream from smartform.

Best regards

Christian

Read only

0 Likes
2,521

Hi, Christian,

It was so long time ago, it's strange to see such an old thread still active. Anyway, thanks for the input! Also, thanks and appologees to Amit and Per. Meanwhile, I was using the HTML control to do it. I found this code in my demos, I guess I dig it out also somewhere from SCN (it was originally showing SmartForm, but I left this part out):

DATA:

  lo_html               TYPE REF TO cl_gui_html_viewer,

  l_url                 TYPE w3url,

  lt_pdf_bin_onefield   TYPE TABLE OF char134,

  gt_pdf                TYPE TABLE OF tline

  lt_pdf_text           TYPE TABLE OF char255.

FIELD-SYMBOLS:

  <ls_pdf>              LIKE LINE OF gt_pdf,

  <ls_pdf_bin_onefield> LIKE LINE OF lt_pdf_bin_onefield.

* convert 2-field itab to 1-field itab

  APPEND LINES OF gt_pdf TO lt_pdf_bin_onefield.

* convert binary to text table

  CALL FUNCTION 'SCMS_BINARY_TO_FTEXT'

    EXPORTING

      input_length          = g_filesize

      mimetype              = 'application/pdf'

    TABLES

      binary_tab            = lt_pdf_bin_onefield

      ftext_tab             = lt_pdf_text.

* create HTML object

  CREATE OBJECT lo_html

    EXPORTING

      parent = cl_gui_container=>default_screen.

* load PDF data (get URL)

  CALL METHOD lo_html->load_data

    EXPORTING

      type         = 'text'

      subtype      = 'pdf'

    IMPORTING

      assigned_url = l_url

    CHANGING

      data_table   = lt_pdf_text.

*   show HTML control with PDF

  lo_html->show_url( l_url ).

Cheers,

Igor

Read only

0 Likes
2,521

Hi Igor,

the FM does the same. It calls although a HTML container to show the PDF .

I activate this thread, because I though the answer wasn't complete. I was although looking forward to such a solution.

Best regards

Christian