cancel
Showing results for 
Search instead for 
Did you mean: 

Remove Application toolbar option in PDF

Former Member
0 Kudos

Hi all,

I'm displaying PO document like in ME29N print preview.In which i have used IFRAME UI Element to pass the PO data by converting the OTF File format to PDF using FM - 'CONVERT_OTF'. But it shows with Application Toolbar of PDF with PRINT and SAVE Option. I dont want to show that option in IFRAME. Is there any option of removing/hiding those option . Or is there anyway of showing the PO document without print and save option. Can anyone help me with this. below is my coding,

CALL FUNCTION fname

EXPORTING

output_options = outopt

control_parameters = conpar

  • user_settings = ' '

ls_ekko = l_doc-xekko

ls_nast = l_nast

IMPORTING

document_output_info = docout

job_output_info = jobout

job_output_options = jobopt

TABLES

i_ekpo = l_doc-xekpo

t_eket = l_doc-xeket

t_ekkn = l_doc-xekkn

t_komv = l_doc-xtkomv

EXCEPTIONS

formatting_error = 1

internal_error = 2

send_error = 3

user_canceled = 4

OTHERS = 5.

call function 'CONVERT_OTF'

exporting

format = 'PDF'

  • MAX_LINEWIDTH = '100'

  • PDF_DELETE_OTFTAB = 'X'

importing

bin_filesize = l_pdf_len

bin_file = l_pdf_xstring

tables

otf = jobout-otfdata

lines = lt_lines.

create object cached_response

type

cl_http_response

exporting

add_c_msg = 1.

l_pdf_len = xstrlen( l_pdf_xstring ).

cached_response->set_data( data = l_pdf_xstring

length = l_pdf_len ).

cached_response->set_header_field( name = if_http_header_fields=>content_type

value = 'application/pdf' ).

cached_response->set_status( code = 200 reason = 'OK' ).

cached_response->server_cache_expire_rel( expires_rel = 180 ).

call function 'GUID_CREATE'

importing

ev_guid_32 = guid.

call method cl_wd_utilities=>construct_wd_url

exporting

application_name = 'APPLICATION_NAME'

importing

out_host = host

out_port = port

out_protocol = protocol

out_local_url = local_url

out_absolute_url = abs_url.

concatenate abs_url '/' guid '.pdf' into display_url.

cl_http_server=>server_cache_upload( url = display_url

response = cached_response ).

DATA lo_nd_url TYPE REF TO if_wd_context_node.

DATA lo_el_url TYPE REF TO if_wd_context_element.

DATA ls_url TYPE wd_this->element_url.

DATA lv_linkurl LIKE ls_url-linkurl.

  • navigate from <CONTEXT> to <URL> via lead selection

lo_nd_url = wd_context->get_child_node( name = wd_this->wdctx_url ).

  • get element via lead selection

lo_el_url = lo_nd_url->get_element( ).

  • get single attribute

lo_el_url->set_attribute(

EXPORTING

name = `LINKURL`

value = display_url ).

Regards,

Ramesh

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Closing this thread due to no correct solution

Edited by: Ramesh Vinay on Nov 6, 2008 3:54 PM

Former Member
0 Kudos

Hi All,

I have set the following code in WDDOMODIFYVIEW.This time i have used Interactive form UI Element instead of Iframe UI Element .But still it is not working. What could be the problem.

LR_WD_FORM ?= VIEW->GET_ELEMENT( 'ADOBEFORM' ).

LR_METHOD_HANDLER ?= LR_WD_FORM->_METHOD_HANDLER.

LR_METHOD_HANDLER->SET_LEGACY_EDITING_ENABLED( ABAP_TRUE ).

  • hide toolbar

LR_METHOD_HANDLER->SET_HIDE_TOOLBARS( I_HIDE_TOOLBARS = ABAP_TRUE ).

  • set view reference

WD_THIS->M_VIEW = VIEW.

Can anyone Plz help me with this

Edited by: Ramesh Vinay on Sep 23, 2008 10:20 AM

Former Member
0 Kudos

Hi ,

I was using the same code and it is working for me. I was able to hide the tool bar in the Interactive form UI Element.

With Regards,

Ranganathan.

Former Member
0 Kudos

Hi,

I'm not getting it. i think some where i have made a mistake in binding or calling it wrongly. Can u tell me how u binded and placed the code.

Former Member
0 Kudos

Hi

Please go to the view where you have the PDF object.

Goto its WDDOMODIFYVIEW then type the code below.

data:

lr_method_handler type ref to IF_WD_IACTIVE_FORM_METHOD_HNDL,

lr_interactive_form type ref to cl_wd_interactive_form.

  • do it only once

If first_time = abap_true.

  • get the method handler

lr_interactive_form ?= view->get_element( 'FINAL_PDF' ).

lr_method_handler ?= lr_interactive_form->_method_handler.

  • hide the toolbars

lr_method_handler->set_hide_toolbars( abap_true ).

Endif.

Please make sure you type the correct name of the 'Interactive Object' in your layout. In my case,

my interactive form object name in the layout is FINAL_PDF.

Hope this help.

Thanks

SK