cancel
Showing results for 
Search instead for 
Did you mean: 

How to dynamically call image in PDF for Acrobat ver 8.1 onwards?

Former Member
0 Kudos

Hi Experts,

I am using Web Dynpro Java. My requirement is to call the images dynamically on a PDF form. There are no of company code. I have to call different logos for different company codes/

We are now using Acrobat 8.1.1. Please refer following thread.

http://kb2.adobe.com/cps/405/kb405270.html

From Acrobat 8.*, we have to use some different method for dynamically calling the images. Earlier we were using the concept mentioned below to dynamically call images.

However this method is not applicable for Acrobat Reader 8.* onwards due to security reasons.


Click on the Layout tab and choose None for the Caption position.
u2022 Click on the Object, then the Binding tab and choose None for Default Binding.
u2022 Click on the Field tab, enter $record.SapOnlineShopUrl for the URL entry, and select Use Image Size for the Sizing field.
u2022 Click on the script editor and enter the following FormCalc script statement, which enables the dynamic integration of the image. Show: initialize Script: this.value.image.href = xfa.resolveNode(this.value.image.href).value; Language: FormCalc Run At: Client

write following code in wddoinit
try { String url = WDURLGenerator.getAbsoluteWebResourceURL( wdComponentAPI.getDeployableObjectPart(), "sap_online_shop.jpg"); wdContext.currentDataSourceElement().setSapOnlineShopUrl(url); } catch(Exception e) { throw new WDRuntimeException(e); }

Please let me know what is the alternate method for Adope ver 8.1.1

Regards,

Gary

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Gary,

Please try the following.

1) Load all images into your SAP system

2) Create a webservice which on call will return you the binary form of the image

3) Read it by creating the correct type in the Context

Another method is loading all the images by embedding it in the form and make them visible/hidden as per the condition. But it will increase your form size and will have performance issues.

Thanks & Regards,

Sanoosh

Former Member
0 Kudos

Hi Sanoos,

Can you please describe your 3rd point in details? It will be helpful for me.

Regards,

Sukalyan

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Gary,

First you upload the image in SAP through se78.then write the below code in your adobe form interface.

data : v_object type TDOBJECTGR value 'GRAPHICS',

v_id type TDIDGR value 'BMAP',

v_btype type TDBTYPE value 'BCOL',

V_FIELD TYPE XSTRING.

V_NAME = 'ZW_DEVMAN_LOGO'.

CALL METHOD cl_ssf_xsf_utilities=>get_bds_graphic_as_bmp

EXPORTING

p_object = v_object " 'GRAPHICS'

p_name = v_name " Name of the logo as in se78

p_id = v_id " 'BMAP'

p_btype = v_btype " 'BCOL' ( whether the image is in color or black and white )

RECEIVING

p_bmp = v_field

EXCEPTIONS

not_found = 1

internal_error = 2

OTHERS = 3.

g_logo = v_field.

Declare g_logo as xstring in global data.

In context of the form make one graphic element with field g_logo and mime type BMP.It will work.

Regards,

Simi A M

Edited by: amsimi on Jan 26, 2011 5:30 AM

Former Member
0 Kudos

Hi simi,

I am having similar problem with Adobe forms,using WebDynpro java. I have searched sdn for solution, but unfortunately all the solutions are in WebDynpro ABAP. Can you confirm that the code sample you have given is in webDynpo Java or in WD ABAP?

Regards,

Sukalyan