cancel
Showing results for 
Search instead for 
Did you mean: 

Image color reverses

Former Member
0 Kudos

Hello All,

I'm adding multiple images dynamically to my form. The 1st image shows up fine, but the next image shows up with reverse colors i.e. black becomes white and white becomes black.

Please, if somebody has an idea why is it happening and what should I do to correct it, please let me know.

Many Thanks,

Vimukta

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Vimukta!

Where does the inverted image appear? Is it at design time or in the pdf-preview or at runtime?

Probably, you marked this image, so it is inverted by the selection.

And which image type do you use? Is it png or tif or jpeg?

Greetings, Philip

Former Member
0 Kudos

Hello Philip,

The inverted image appears at the run-time, since I'm adding images dynamically at run-time. During design-time and PDF-Preview time, it is just a place-holder - no image appears.

Where can I mark the image? May un-knowingly I have done that and I don't know.

The image type is tif.

Thanks,

Vimukta

Former Member
0 Kudos

Hm... that sounds strange... Can you post the code snipplet for adding the image dynamically?

Former Member
0 Kudos

Hi ,

Have you tried to add these images at design time ? Please try this one if it helps .

Provide with the code snippet you are using for adding images dynamically.

Regards,

Nanda

Former Member
0 Kudos

hi Vimukta,

If you are trying to display the images dynamically based on some condition, if I am getting you right then I assume the kind of code you are using for dynamic image generation is this, if not try out the code:

create a value attribute InvoiceUrl in the context under the node which you are considering as the data source for the Interactive form.

try {

String url = WDURLGenerator.getAbsoluteWebResourceURL(wdComponentAPI.getDeployableObjectPart(),"abc.bmp");

wdContext.current<context>Element().setInvoiceUrl(url);

}

And the code that you have to use in the SAP script is formcalc(language) and client(runtime)

if($.isNull) then

$.presence = "hidden"

else

this.value.image.href = xfa.resolveNode(this.value.image.href).value;

endif

Note the binding should be: None

and the URL parameter should point to the attribute that you have created:

$record.InvoiceUrl

PLease try out this, hope this helps out.

Thanks,

kris

Former Member
0 Kudos

Thank you all for your replies.

I solved the problem :-).

Earlier, I had written the script like -

this.value.image.href = xfa.resolveNode(this.value.image.href).value;

and

tied URL parameter to DrawingURL (which was set in the wdDoInit() Code).

Instead of this now I put the script -

this.value.image.href = DrawingURL.rawValue;

and

URL parameter is blank now.

Don't know how but this solved my problem, now each of the images is showing up correctly.

Thanks,

Vimukta

PS: Kris, I awarded you points for your help.