cancel
Showing results for 
Search instead for 
Did you mean: 

Download PDF

Former Member
0 Kudos

Hi all,

I'd like to download an Adobe Interactive form generated by a Web Dynpro application using the following piece of html code:

<a href="URL_TO_JAVA_WEB_DYNPRO_APP">download pdf</a>

So how can I offer the pdf directly in a web dynpro application (how can I get a direct link to the pdf)?

Thanks,

Jeroen

Accepted Solutions (1)

Accepted Solutions (1)

Sigiswald
Contributor
0 Kudos

Hi Jeroen,

If you prefer to use a real link instead of a FileDownload UI element, you can create a LinkToURL UI element and set the "reference" property (via a context attribute) at runtime using the Web Dynpro Binary Cache service.


  String pdfUrl = getCachedWebResourceUrl(
    pdfSource, pdfName, WDWebResourceType.PDF);
  wdContext.currentContextElement().setPdfUrl(pdfUrl);

with


  private String getCachedWebResourceUrl(
    byte[] data,
    String name,
    WDWebResourceType type)
    throws WDURLException {

    if (data == null || data.length == 0) {
      return null;
    }

    return getCachedWebResource(data, name, type).getURL();
  }

  private IWDCachedWebResource getCachedWebResource(
    byte[] data,
    String name,
    WDWebResourceType type) {
    IWDCachedWebResource cachedWebResource = null;

    if (data != null) {
      cachedWebResource = WDWebResource.getWebResource(data, type);
      cachedWebResource.setResourceName(name);
    }

    return cachedWebResource;
  }

By default the generated URL is only valid for the user's session (95% sure), but you can influence this via the WDWebResource API.

Kind regards,

/Sigiswald

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

I have downloaded adobe 7.0 for ISR and PCR development.When i open the adobe form in portal it is working fine.But when i click to next page , it is giving the microsoft error with send IE error report.

It was working fine with adobe 6.2.

I realy appreciate the earlier response.

Thanks,

thiru

Former Member
0 Kudos

See

markus_meisl
Active Contributor
0 Kudos

By providing a download view from where to retrieve the form. See the corresponding tutorial at http://sdn.sap.com/irj/sdn/downloaditem?rid=/library/uuid/2dd3dbcd-0401-0010-55b8-b10808ff688e

Regards,

Markus

Former Member
0 Kudos

Hi,

I'm using NW2004s (BS10.6)

The tutorial at

http://sdn.sap.com/irj/sdn/downloaditem?rid=/library/uuid/2dd3dbcd-0401-0010-55b8-b10808ff688e

uses deprecated classes. Is there an updated tutorial?

Thanks,

Juan