cancel
Showing results for 
Search instead for 
Did you mean: 

Displaying PDF in new Browser window

Sm1tje
Active Contributor
0 Kudos

Hi all,

I have a question about displaying a invoices in pdf format in a new window. I read several threads about this, but I haven't been able to solve my problem.

I'm using following code:

  • append the pdf to the response

cl_wd_runtime_services=>attach_file_to_response(

i_filename = 'test.pdf'

i_content = lx_pdf

i_mime_type = 'application/pdf'

i_in_new_window = ' X'

i_inplace = 'X' ).

The content (lx_pdf) is retrieved from a smartform, via the function module for the smartform in question, after which I convert the OTF Data (JOB_OUTPUT_INFO-OTFDATA) to XSTRING using FM SCMS_TEXT_TO_XSTRING. The returned data (buffer of type xstring) I use for afore mentioned method. But all I get to see is the following:

//XHPLJIIID 0700 00000000001

IN04EZZ_MO_SMARTFORM_TEST

IN05TEST_PAGE_1

OPDINA4 P 144 240 1683811906000010000100001

IN06MAIN

IN06TEXT_TEST1

MT0168902156

CP11000000E

FCCOURIER 120 00144 SF001SF001110000144E

UL +0000000000000

CT00000000

ST0590441This is a text page for displaying PDF in a

MT0168902396

ST0547238new window

MT0168902636

ST0460832called from within a WD application

MT0168902876

ST0144010Application

EP

//

The text is correct, but it is not displayed as PDF in new window, and of course I'm not interested in all the formatting codes in front of every line??

I should be possible to display a pdf in a new browser window without having installed everything needed for Adobe Interactive forms, or isn't it??

Kind regards,

Micky.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Micky,

Don't convert the OTFDATA.Keep it as it is.

I'm doing the same thing except conversion of OTFDATA & it is working fine with me.

regards,

rajesh.

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Micky.

If you have the spool number of the printed billing document you can use

component WDK_SPOOL_TO_PDF in order to display spool as PDF.

Just transfer spool number and format to default inbound start up plug.

Cheers,

Sascha

Sm1tje
Active Contributor
0 Kudos

No, Ik do not have the spool number, and neither will I in the future. The pdf documents are stored in a central place, from where I will have to retrieve I using an URL.

Thanks anyway.

Regards,

Micky.

Sm1tje
Active Contributor
0 Kudos

Anyone any suggestions??

Regards,

Micky.