• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

how to save a table from jsp

 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I have a jsp page with a table in it. The rows and columns contain external links which open in a new window and the table formatting is done using CSS. I want to use the table in a powerpoint slide. I am unable to save the table as an image, from the jsp page, as it is saved as .html and the cell borders and other formatting is lost. Any suggestions on how to go around this.

Thanks in advance,
sridhara.
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Do a screen capture?
 
sridhar anna
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the reply. A screen capture has a lot of information which is unwanted for in a ppt presentation. There are ways to convert jsp content into pdf using some tools. I was wondering if there is a similar way to work with ppt.

Thanks,
Sridhara
 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by sridhar anna:
Thanks for the reply. A screen capture has a lot of information which is unwanted for in a ppt presentation.





What kind of unwanted information are you talking about? It's just an image. Crop out only the table from the image and you are left with, well, an image of the table, just like you want. Seriously, what are you talking about?
 
sridhar anna
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My apologies for the confusion. I just meant that on a screen shot there is banner, navigation, open windows, browser etc. I can crop out the table, but I am looking for a better way where I donot need to crop the image. I would like to export the image from the jsp page directly into ppt.

An example: If I had some text on a jsp page and I wanted that text as a word document, I would like to click on a link to open/view that text as a word document, rather than copy-paste the text and make a word document.

I would like to view the image/table in ppt without the screenshot. Let me know if you have any suggestions.

Thanks,
sridhara.
 
sridhar anna
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I have jsp page with a table in it. The table is formatted using CSS. I want to save the table on my desktop as an image. Are there any java classes or API that could be used? or can the jsp page be converted to xml, and parsed as an image? Are there any tools available?

I donot want to take screenshot and crop image. I want to write some code so that an image is generated by clicking on a link on the jsp page.

Please reply.

Thanks so much.
sridhara.
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There is no way that I know of to take a screen grab of a page once it has been sent to the browser.

One thing you might consider is to use a servlet filter and response wrapper to "grap" the HTML page just before it is sent to the browser. Then you could parse the HTML and perhaps create a PDF of the page.
 
sridhar anna
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Then you could parse the HTML and perhaps create a PDF of the page.

Could you please explain how to parse the HTML into an image. Is there any tool or API available.

Thank You,
sridhara.
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There may be. I personally do not know of any HTML-to-PDF converters.

However a google search of "java HTML PDF converter" yielded some promising looking hits.
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
On the other hand, I'd personally back off and use an entirely different approach.

Rather than try to convert the rendered HTML to an image or PDF or whatever, I'd start with the raw data that you fed to your JSP in the first place and construct the PDF using something like iText.
 
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is your table generated dynamically or is the HTML hard-coded? If it's dynamic, you could add a hidden field on your JSP that contains the XML equivalent of your table and then do an XSL transform on it to convert to Word or PDF or whatever. Tedious, time-consuming and tiring, but it works...
 
sridhar anna
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you for the replies.

My table is generated dynamically and the formatting is with CSS. I will try the servlet filter approach and also the XML approach. I will let you know if it works.

Thanks,
sridhara.
 
Ranch Hand
Posts: 155
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Use Alt + print screen and make sure u have focus on the table it won't capture other minimized windows and other stuff..just get things with focus
and capture the image
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic