cancel
Showing results for 
Search instead for 
Did you mean: 

Need to change the background color of a textview in offline PDF

Former Member
0 Kudos

Hi,

We are using the PDFDocument API in order to generate a PDF file which is eventually stored in a network folder. We were initially using the Webdynpro Interactive Form UI element, but digressed from that approach because of some architecture considerations.

I am able to do everything with the PDFDocument API, expect two things which are proving to be much tougher than I thought:

1) I have a textview in my .XDP template. The background color of this textview must change depending on the value that I display inside it. For example, if the value is between 1 and 20, the background color must be green, if the value is between 21 and 40, it must be yellow and so on...

I still have not found the method to specify the background color of a textview using the .XML data file.

2) Depending on a certain condition, I need to display 5 images in a table row instead of the usual 6. I have been able to do that by simply not providing the 6th image url, but I also need to resize the 5 such that they occupy the space that was initially used by 6 images.

Any ideas of how I can go about these requirements?

Thanks & regards,

Navneet Nair.

Edited by: Navneet Nair on Feb 19, 2009 10:09 AM

Accepted Solutions (0)

Answers (2)

Answers (2)

0 Kudos

Hi Navneet,

I have a similar requirement of generating an adobe interactive form from a xml data. Can you please help me with the process to be followed?

Thanks n Regards

Renu Nair.

Former Member
0 Kudos

I solved the problem myself. Had to include some scripting inside the .XDP template to make it happen. I'll be glad to help if anyone needs help!

- Navneet

Sandra_Rossi
Active Contributor
0 Kudos

How did you do it ? thx

Former Member
0 Kudos

1) I added an invisible textfield inside my .XDP file and populated it with the color value that I want my main text field to display. (This color needs to be specified in the R,G,B format... for example... 128,0,0

2) Now in the 'Initialize' javascript event of my main text field, I included the following script:

this.resolveNode("<SubFormName>.<MainTextFieldName>").fillColor = this.resolveNode("<SubFormName>.<InvisibleTextFieldName>").rawValue;

Hope it helps!

- Navneet

Sandra_Rossi
Active Contributor
0 Kudos

Thank you very much for the feedback