cancel
Showing results for 
Search instead for 
Did you mean: 

How to get Url to generated pdf?

Former Member
0 Kudos

Hi Experts,

I have generated a PDF successfully and it is displayed in a new IE window. If I use HTTPWatch to track which traffic happens I can see, that an Url is send to the browser, which contains the Url to the pdf.

here is an example of the url:

<servername and port>/webdynpro/dispatcher/path/to/application/~wd_key~YC69GWiqO4s5kL53qmuaZA==~md/factsheet.pdf?sap-wd-download=4&sap-wd-cltwndid=c9e276f2070011de9e2a00145ec2715e&sap-wd-appwndid=c9e276f3070011de854a00145ec2715e&sap-wd-norefresh=X

With this url I can open a new window and display this pdf as long as I am in the same browser session.

This is the url I need to get, but I no idea how.

What I have found out so far:

If you bind the generated pdf to a binary context node (pdfsource) and you display this field as a textview you will see parts of this url

../../path/to/application/~wd_key~YC69GWiqO4s5kL53qmuaZA==~md/factsheet.pdf?sap-wd-download=4&sap-wd-cltwndid=c9e276f2070011de9e2a00145ec2715e&sap-wd-appwndid=c9e276f3070011de854a00145ec2715e&sap-wd-norefresh=X

but I can't get this url from the pdfsource object.

If I try pdfsource.toString() - I will get the referenced object

If I try new String(pdfsource) - I will get the pdf as data

There are no other methods available ...

Well there is a dirty way to get this data, but I won't use this in a productive application:

I can get the textview and get its value ... but this is really rough!

Thx in advance

Fabian

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Fabian,

Could you please also share what you want to do with the PDF? You are asking for access to a temporary binary of Web Dynpro. Depending on your use case there might be better options.

Regards,

Juergen

Former Member
0 Kudos

Of course.

There are two things that I want to do with the generated pdf.

1) Open the generated pdf in a new IE window to show to user if the data is correct

2) Save the binary in a document management system via R/3 backend system

For option 1) is asked this question

For option 2) i will send the binary to R/3, rest is out of my scope

Maybe you have an idea how to send the binary to a new IE window, so that I don't need the temporary url.

Regards,

Fabian

Former Member
0 Kudos

Hi Fabian,

A Web Dynpro ABAP expert told me that you need bind the pdfSource and then open a new browser window displaying the pdfSource or attach it to the response (in WDA attach_file_to_response).

I cannot tell you if it works the same with Web Dynpro Java.

Hope this gives you some pointers for further investigations.

Regards,

Juergen

Former Member
0 Kudos

Hi Juergen,

thx for your tips.

I tried to find out how to get the response in Java WebDynpro, but I haven't found a way so far. But this is part of another forum, maybe I will ask there how to get the servlet response.

I will mark this thread as solved, even if I don't know how to get the url from the temporary generated pdf.

I will keep on trying to parse the pdf stream to IE.

Regards,

Fabian