Quantcast
Channel: SCN : All Content - ABAP Development
Viewing all articles
Browse latest Browse all 8332

CL_GUI_HTML_VIEWER - Print PDF URL without showing popup

$
0
0

Hello everyone,

 

My requirement is the following:

 

I need a way to print a PDF document from an URL (something like this: http://some_site/PDFServlet?docId=gJuc/VGqTneA22iKribRY(MaS)LW3c4abQ47)

 

Right now, I get this through method show_url from class CL_GUI_HTML_VIEWER. It opens a popup window, showing it, then the user clicks on the Print button, and the job's done!

But now, they want to print it in silent mode, meaning no more popup window!



This is a code snippet of what I'm using to show and print the PDF file:


PBO:


...

CALL METHOD go_html_control->show_url

       EXPORTING

         url = gv_url.



PAI:


...

CALL METHOD go_html_control->execwb

       EXPORTING

         cmd_id     = '6'

         cmd_opt    = '2'

       EXCEPTIONS

         cntl_error = 1.

     IF sy-subrc <> 0.

       MESSAGE e003(cnht) RAISING html_print_error.

     ENDIF.




I've tried the following change, but it doesn't work:

 

PBO

...

CALL METHOD go_html_control->show_url

       EXPORTING

         url = gv_url.

...

CALL METHOD go_html_control->execwb

       EXPORTING

         cmd_id     = '6'

         cmd_opt    = '2'

       EXCEPTIONS

         cntl_error = 1.

     IF sy-subrc <> 0.

       MESSAGE e003(cnht) RAISING html_print_error.

     ENDIF.

 

LEAVE TO SCREEN 0.

 

It only prints a blank page. I suppose it doesn't work because at the time I call the printing command, the windows is not active.

 

Any help will be appreciated!

 

Regards

Fabian


Viewing all articles
Browse latest Browse all 8332

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>