wood burning stoves 2.0*
The moose likes Java in General and the fly likes Displaying scalable vector graphics on ibm aix Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Displaying scalable vector graphics on ibm aix" Watch "Displaying scalable vector graphics on ibm aix" New topic
Author

Displaying scalable vector graphics on ibm aix

Vamsi bhujanga
Greenhorn

Joined: Jun 14, 2008
Posts: 16
We are preparing a bill template (say mobile bill kind of bill) and we need to display a chart for the last 3 months calls in the template.
We are able to display the template which is a pdf file using FOP. But, the actual problem is we need to display a generic graph in the pdf for each customer in the bill template.

We have tried using JFreechart and display the chart. Iam able to save in the windows machine. But, iam unable to save it in the server (this is a part of our busineess logic design where we are trying to store the chart in the server and append this to the pdf.)

For displaying SVG(Scalable Vector Graphics) images on the invoice after running fop-0.94, we need X11 library. But after installing this also, we are unable to see the bar graph chart on the invoice through X Manager (GUI for IBM AIX Server).

Moreover while generating bar graph through Jfreechart taking help of two libraries (jfreechart-1.0.4.jar,jcommon.jar) also, the same thing happens and we are unable to see the bar graph chart on the invoice through X Manager.

But in both the cases, we are getting the bar graph generated on Windows System successfully.

These are the responses from the fop-users and fop-development groups (where i browsed through google):-
If you just want to display SVG images, that requires Apache Batik in the classpath . Batik is bundled with FOP.

For SVG you need the batik libraries, which are part of the fop standard distribution. So the problem here seems to be something else.

I currently know of no FOP extensions that would allow to add bar graphs(you mean charts, right?) in a special XML dialect as part of an
fo:instream-foreign-object. So that means you have to generate SVG graphics from bar graphics using a third-party tool

Findings from the above discussions :-

It may be a case that something is missing in the AIX Operating System which is restricting us to allow/create dynamic images on the invoice through either of the above two methods.
Nitesh Kant
Bartender

Joined: Feb 25, 2007
Posts: 1638

Looks like it is more or less related to Apache FO. You will get better answers in Other Open source projects forum. Moving ....


apigee, a better way to API!
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41884
    
  63
So... the reason you're looking into SVG is because you couldn't get JFreeChart to work on AIX? If that's the case I'd investigate why that's happening. Generally, it works just fine.

we are unable to see the bar graph chart

What does this mean? Is the chart being created? If it is created, can you save it to disk? If you can save it to disk, is it a valid image file? If it is a valid image file, what stands between having a valid image file and displaying it? TellTheDetails


Ping & DNS - my free Android networking tools app
Vamsi bhujanga
Greenhorn

Joined: Jun 14, 2008
Posts: 16
Moreover when we contacted IBM customer care, this is the reply we received.

IBM response:
Unfortunately Adobe's SVG Viewer is no longer available for AIX. We found that Adobe has decided to discontinue it's SVG Viewer product. Please refer the following links for more details.

http://www.adobe.com/svg/eol.html
http://www.adobe.com/svg/pdfs/ASV_EOL_FAQ.pdf

But there are some other Adobe products which currently supports SVG. Also there are a lot of third party SVG viewer products.


Please suggest

For the question: we are unable to see the bar graph chart


Here is the sample code we are using.. (SOme things are changed accordingly)



This code works fine and creates a jpeg on Windows OS.
But, this doesnot save when we run ON AIX. Basically, we need to save this on the server to do other operations.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41884
    
  63
What do you mean by "this does not save"? I don't see any code that would save anything to a file. It also doesn't use JFreeChart.
Vamsi bhujanga
Greenhorn

Joined: Jun 14, 2008
Posts: 16
Sorry i kept the wrong code initially. I have updated the previous post.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41884
    
  63
Make sure that the account used to run this code has access rights to whatever directory you're using on the server to write the file to (obviously, AIX does not have a "C:/" directory).
Vamsi bhujanga
Greenhorn

Joined: Jun 14, 2008
Posts: 16
As i mentioned in the post, some code is modified for some reasons. I have given the server location in place of C:/ directory.
Anyhow, here is the url which states that Adobe is discontinuing the SVG. Now, iam in search of any 3rd party tool which supports SVG on AIX.
Iam sure that some one would be working on this.Any help will be greatly appreciated.

http://www.adobe.com/svg/eol.html

Thanks in advance
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41884
    
  63
As i mentioned in the post, some code is modified for some reasons.

Ah. Well, posting code that works to illustrate code that doesn't work is of limited usefulness.

I have given the server location in place of C:/ directory.

And that directory is accessible by the account the server runs under, and is not prohibited by a security policy?

Now, iam in search of any 3rd party tool which supports SVG on AIX.

You mentioned Batik before, but I don't quite understand why that didn't work out. Can you post the specific details of that?
Vamsi bhujanga
Greenhorn

Joined: Jun 14, 2008
Posts: 16
You mentioned Batik before, but I don't quite understand why that didn't work out. Can you post the specific details of that?


Batik is a bundled with FOP itself. We are even confused and struggling here in displaying SVG.
As i mentioned in my earlier post, SVG viewer is no longer supporting AIX.
Please suggest an alternate solution for this. Is there any 3rd party tool that can be useful to display chart on AIX OS.Iam searching for this kind of tool.Can anybody suggest me.

Thanks in advance.

Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41884
    
  63
I still think trying to figure out the problem with JFreeChart might get you a solution much quicker than resorting to SVG instead.
Vamsi bhujanga
Greenhorn

Joined: Jun 14, 2008
Posts: 16
I have copied the code of JFreeChart in my previous post (which iam using). What else can be updated in it? IS there anything incorrect or did i miss anything else??

Also,if everything is correct (iam sure it would be), what can be the alternate to save the image in the AIX?

Please suggest.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41884
    
  63
In my very first post in this topic I asked "Is the chart being created? If it is created, can you save it to disk? If you can save it to disk, is it a valid image file? If it is a valid image file, what stands between having a valid image file and displaying it?" I've yet to see any indication that you have tried to answer any of these.

Later on I wrote "And that directory is accessible by the account the server runs under, and is not prohibited by a security policy?" You haven't responded to that one, either.
Vamsi bhujanga
Greenhorn

Joined: Jun 14, 2008
Posts: 16
The chart is being created.
Iam able to save on the hard disk (on Windows OS).
It is a valid image

The same image when i tried to save on AIX server, it is restricting as i told in my above post.
Also, the directory where iam trying to save is not restricted on any security policy of the server.

Ulf Dittmer,
Hope, i answered to all the questions.

In my earlier post, i have mentioned that Adobe- no more supports SVG viewer. I am in search of 3rd party tool to save the image on the AIX. please suggest (Hope, my question is clear now).


Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41884
    
  63
The same image when i tried to save on AIX server, it is restricting as i told in my above post.
Also, the directory where iam trying to save is not restricted on any security policy of the server.

What does "it is restricting" mean? Is there an exception? If so, post the stack trace. I doubt that Java code can do file I/O operations that do not succeed, yet the JVM would not produce exceptions.
 
Don't get me started about those stupid light bulbs.
 
subject: Displaying scalable vector graphics on ibm aix