on 02-18-2009 6:51 PM
Hello All,
I want to display images in Adobe form. I've done the following. The images are not static but dynamic - for each time the form loads the images are different.
-
1. Created the image field (Va_Image)
2. The URL for the image comes from a Context node which is mapped to the PDF DataSource.
3. i mapped the context node to a invisible TextField (Image_URL)
4. I wrote the following script (to set the href of image dynamically) in the initialize event of the Page1 on which the text field and image are present
xfa.form.Vn_MasterRecord.Page1.Va_Image.value.image.href = xfa.form.Vn_MasterRecord.Page1.Image_URL.rawValue
5. On preview of the PDF in Adobe Live Cycle Designer, i get the image correctly.
-
However, when i execute the Webdynpro application (java), the image doesn't appear on my final screen.
Any pointers? am i missing something?
Points assured for good answers.
Thanks in advance,
Regards,
ak
hi,
if in ur webdynpro u have declared
value node: info
value attributes: name,age.
bind info to ur data source
info along with name and age will be listed under the data view tab in livecycle designer.
drag and drop name and age from the data view to the page
if u have a button say submit in ur page,in the click event (or any other event)
u can have d code
var name_val=xfa.form.Myform.name.rawValue;
var name_val=xfa.form.Myform.age.rawValue;
where Myform is the name of ur form.
Regards
Jay
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,
use th same code of urs under form:ready event of javascript
Regards
Jayapriya
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jayapriya,
Thanks for the reply.
I'm little confused here. form:ready event is available for Image Field and all the subform/pages. i tried to put the same script on each of them (trial and error). But all seem to give me the same output.
If its not too much of a trouble, can you post me a sample XDP that works for you. I can compare the source of that and mine to see what mistake i'm doing.
(id is on my profile - we aren't allowed to post mail ids on this forums).
btw, I'm using Adobe Designer version 8.0 and reader 9.0.
Thanks a lot in advance,
Regards,
ak
Hi Jayapriya,
i got it... Thanks to you... as you said, i need to write that formcalc script in form:ready of the Image Field UI element. and it worked...
I have just one more question. How can i access the value attribute in the data source?
if my Data source is of the form Vn_DS and i have a value attribute Va_Attr1 under Vn_D. i have to access the Va_Attr1 from the script, can you please tell me how to access using the script?
Thanks
ak
Hi Arun -
For dynamic image,
You cannot directly display a logo which is uploaded in se78 on an adobe form. The image format needs a conversion.
- You can write this code in your interface section.
- Create a global variable g_logo of type xstring."converted logo and v_name of type STXBITMAPS-TDNAME. "logo name in se78.
- Pass these parameters of the image in se78 to this method.
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.
- The variable g_logo will have the converted image.
- Drag g_logo into the context from the interface.
- Finally, in the context of the adobe form, make a graphics node and choose Graphic Type as Graphic Content.
- The Field should have the global variable g_logo and the mime type is 'BMP' (with quotes).
- Create an image field (not just image. That would be static) and in binding, bind it to g_logo and check the check box u2018Embed image datau2019.
I think, this should work.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Vishal,
Thanks for the reply. I'm afraid that might not work as i'm using Webdynpro for Java and not ABAP. Anypointers again?
Hello Jay,
Thanks for the reply. I have the Image as an URL. for e.g: its of the type http://xyz.com/Images/Picture1.jpg and i gave that as an input in the script. Your method may work if i have the Image as a mime type and i try to access that image form the Mimetype.
In my case, any more pointers?
Thanks
ak
I did the following process to load a dynamic image (getting my image stored through transaction SE78) and followed all the steps suggested.
What happened is that the pdf file created shows 58 KB file size but when I try to open the pdf file, the page is blank.
Before assigning the image as described in Vishal's email, the pdf file showed all the fields in the form.
Please help.
Thanks.
Jitendra Mehta
hi,
in the wdDoInit method:
try
{
String url = WDURLGenerator.getAbsoluteWebResourceURL(
wdComponentAPI.getDeployableObjectPart(),"YourImage.jpg");
wdContext.currentDataSourceElement().setYourImageUrll(url);
}
catch(Exception e)
{
throw new WDRuntimeException(e);
}
YourImageUrl--->context element that is bound to the image field
this vl initialize the context element.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.