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

View PDF without saving

0 Likes
1,195

Good day all.I am combining data I read from the database with a PDF. I then view the filled in PDF using cl_gui_html_viewer. It seems I have to save the filled in PDF to my desktop before I can view it. Is there a way to view the filled in PDF without saving it?

3 REPLIES 3
Read only

FredericGirod
Active Contributor
1,046

    CALL METHOD pdf_html_control->load_data
    EXPORTING
      url          = i_url
        size         = l_len
      type         = 'application'
      subtype      = 'pdf'
    IMPORTING
      assigned_url = l_url
    CHANGING
      data_table   = l_pdf_data
    EXCEPTIONS
      OTHERS       = 1.

This is the code of the SP02, display PDF spool. There is no file

Read only

1,046

Mathew Laba Here is a Minimal Reproducible Example:

PARAMETERS dummy.
DATA go_html_viewer TYPE REF TO cl_gui_html_viewer.

AT SELECTION-SCREEN OUTPUT.
  IF go_html_viewer IS NOT BOUND.
    DATA: l_url   TYPE cndp_url,
          l_text  TYPE string.

    l_text = '<html><body><b>hello</b> <i>world</i></body></html>'.

    go_html_viewer = NEW cl_gui_html_viewer( parent = cl_gui_container=>screen0 ).

    data(soli_tab) = cl_bcs_convert=>string_to_soli( l_text ).
    go_html_viewer->load_data(
        EXPORTING type = 'text' subtype = 'html' size = strlen( l_text )
        IMPORTING assigned_url = l_url
        CHANGING  data_table = soli_tab ).

    go_html_viewer->show_url( url = l_url ).
  ENDIF.
Read only

0 Likes
1,046

My implementation saves a file...then loads and displays. Can you point me to an example which I can take a look at? Thanks. Mat.