cancel
Showing results for 
Search instead for 
Did you mean: 

Image field dynamic display employee photo

Former Member
0 Kudos

Hi experts :

Now i develop employee CV programe use adobe form, when a employee open his CV,his photo will display in PDF dynamicly.

when i use the script :this.value.image.href = xfa.resolveNode(this.value.image.href).value;When preview it these error display : Script failed (language is formcalc ;context is xfa[0].form[0].Node[0].page1[0].ImageField[0])scripts= this.value.image.href = xfa.resolveNode(this.value.image.href).value;

Error : Malformed SOM expression;

The Photo do not display in PDF form.

Can you tell me how do you do with it?

thank you

zunxian

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

zunxian,

Try this in Java script,

Imagefield.value.image.href =Textfield.rawValue

Textfield --- where you r getting your url.,keep this as invisible .

Thanks and Regards,

Siva

Former Member
0 Kudos

Hi,

The problem is that Adobe doesnt support this feature of href from reader 8.1 onwards...

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi ,

If you are using Interactive Forms with WDJ then you can use a Modifiable Binary type to pass the image to the PDF.

Then in the PDF script you can use the "Formatted Value" property.

Try the following code

byte[]  l_companylogo = emp_table<i>.getCompanyLogo();
IWDResource l_resource = WDResourceFactory.createCachedResource
							(l_companylogo,"MyImage",WDWebResourceType.JPG_IMAGE);

wdContext.currentContextElement().setCtx_va_imagebinary(l_companylogo);

Make sure you pass the l_companylogo field above to the Adobe form.

Write the follwing FormCalcscript on the "initialise" method of the Image field in the form :

M_myform.#subform[0].Subform1.ImageField1.formattedValue

Thanks,

Virag

Former Member
0 Kudos

Hi Virag:

Thank you and your answer.

May I ask you another question ?

These code I canu2019t understand

1.byte[] l_companylogo = emp_table<i>.getCompanyLogo();

What is 'emp_table<i>' and 'getCompanyLogo();'

2.Ctx_va_imagebinary is the pdfSource?

Now I want to display employees photos in PDF from a file system.I can get the URL with the file system.How can i do it?

Thank you a lot!

yours zunxian