cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic Diagram & Interactive Forms

Former Member
0 Kudos

Hello All!

Maybe you could help me with this question:

I want to place dynamic diagram in my PDF created via Adobe Interactive Forms and Java. Probably I could use Image Field and base64 encoded picture as input field.

Is it possible to use Java WebDynpro Business Graphic for this case? Or there are some special solutions?

Could you share some examples?

Thank you in advance,

Ivan Galkin

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Ivan,

Did you solve this problem? I'm having just the same problem trying to use inside the Interactive Forms a chart generated with Java WD BussinessGraphics.

Thanks in advance,

Andre Souza

Former Member
0 Kudos

Hi All,

I am not sure, but probably I could draw all diagram bars "manual" - in JavaScript there are many functions for drawing simple objects like dots, lines, rectangles, circles etc. It would be a hard work, but I'm willing.

this code draws in Acrobat a three leaf rose on a first page...

var inch = 72, x0 = 2*inch, y0 = 4*inch;
var scaledInch = .5*inch;
var nNodes = 60;
var theta = 2*Math.PI/nNodes;
var points = new Array();
for (var i = 0; i <= nNodes; i++) {
    Theta = i*theta;
    points<i> = [x0 + 2*Math.cos(3*Theta)*Math.cos(Theta)*scaledInch,
    y0 + 2*Math.cos(3*Theta)*Math.sin(Theta)*scaledInch];    
}
var annot = this.addAnnot({
	type: "Ink",
	page: 0,
	name: "myRose",
	author: "A. C. Robat",
	contents: "Three leaf rose",
	gestures: [points],
	strokeColor: color.red,
	width: 1
});

... it means you can draw vector graphic of any complexity.

But of course it doesn't work in Interactive Forms. In manual Converting Acrobat® JavaScript for Use inLiveCycle™ Designer Forms you see that in LiveCycle Designer is no analogy to doc.addAnnot() (xfa.host.addAnnot() or xfa.layout.addAnnot() doesn't work).

How can I put dynamical generated diagram in my PDF?

I have not found any solution.

Thank you in advance.

Ivan Galkin

Former Member
0 Kudos

Hello, Vanja!

As I can see you are fond of difficult tasks. I'm still trying to script your idea of table of contents and with not much luck...

As for this task of yours - I'm not working with Java part of WebAS (my usage of Adobe is limited to ABAP print forms),

but if you are working with Java, then maybe you can generate (using Java and maybe some library if needed) a picture of your diagram,

store it on server and then include this picture into your form as it is usually done?

Former Member
0 Kudos

>

> Hello, Vanja!

>

> As I can see you are fond of difficult tasks. I'm still trying to script your idea of table of contents and with not much luck...

Hello, Petr

It's very pleasant to get tips, especially from fellow countryman. Your words about difficult tasks are complements for me

>

> As for this task of yours - I'm not working with Java part of WebAS (my usage of Adobe is limited to ABAP print forms),

> but if you are working with Java, then maybe you can generate (using Java and maybe some library if needed) a picture of your diagram,

> store it on server and then include this picture into your form as it is usually done?

You have right. Now I try to use a WebDynpro UI component called BusinessGraphics. It generates a GIF picture on a web page with required diagram.

Current question to experts is:

How could I get a URL of generated picture?

Because after this it's easy to transfer URL to some hidden field of PDF and call a JavaScript like this:


//JavaScript at Client initialize of Image Field
if (URLField.rawValue != null){
 this.value.image.href = URLField.rawValue
 this.access = "nonInteractive"
}

Please help - I would very happy,

Thank you in advance,

Ivan Galkin

Former Member
0 Kudos

Are you sure you need URL? Can't you get generated picture as binary data, move it to variable and link this variable to Adobe's Image Field?

Former Member
0 Kudos

Hello Petr,

you're right. Now I can get an URL of a generated diagram and it's not difficult:


import com.sap.tc.webdynpro.clientserver.uielib.graphics.api.*;
import com.sap.tc.webdynpro.clientserver.uielib.graphics.impl.*;

//Implementation of current view:
public static void wdDoModifyView(...){

 IWDBusinessGraphics graphic = (IWDBusinessGraphics)view.getElement("<your_businessgraphic_element>");
 AbstractIgsElement aiElement = (AbstractIgsElement) graphic;

 if (!firstTime){ //else aiElement will be a null pointer?
   String localURL = aiElement.getImageSource();	
   String absoluteURL = localURL.replaceFirst("../..","http://<servername>:<pornumber>/webdynpro/dispatcher");		
   wdThis.wdGetContext().node<SomeNode>().current<SomeElement>Element().set<SomeValue>(absoluteURL);
 }
}

so you assign URL to some context value SomeValue, transport it in your InteractiveForm and write initial JavaScript of image field (s. above).

It would perfect work if picture url would be like http://www.acme.com/resources/images/anvil.gif

But... a value of absoluteURL is like...

http://<servername>:<portname>/webdynpro/dispatcher/local/WS_IF/WebService_InteractiveForms/~wd_key2...

... and my Acrobat 6 and Acrobat Reader 7 doesn't understand such a URL.

So once solution I see now is to save BusinessGraphic's picture in an internal context value and transfer it to InteractiveForms.

Has somebody an idea how can I do it? I doesn't find something like that in sdn or help...

Thank you in advance,

Ivan

Former Member
0 Kudos

Ivan!

I'm sorry, but this is far beyond my knowledge of J2EE and SAP WebAS.

The only feeling I have is that your solution is becoming difficult to understand.

That is a first sing that you are moving in the, let's say, not absolutely straight forward direction.

Did you ask the question on how to receive binary data from URL in the general Web AS or UI forums?

Regards,

Petr

Former Member
0 Kudos

Hi,

Have your image in mimes and try this,

String url = WDURLGenerator.getAbsoluteWebResourceURL( wdComponentAPI.getDeployableObjectPart(),"sample.jpg");

wdContext.currentVaImageNodeElement().setVaImage(url);

This works fine with Acrobat 7 and above...

Thanks

Gopal

Former Member
0 Kudos

Hi Ivan,

Using WDP business graphics doesnt seems to be feasible here.

Regards,

Arafat

Former Member
0 Kudos

Hi Arafat,

Maybe you have some better idea?

Thank you,

Ivan Galkin