Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
How to convert to PDF from my JSP/HTML file?.
I want to convert a particular part of my webpage to a PDF file. Is it possible?
Yes. Take a good look at booth Apache FOP and iText. No matter what you use, you'll probably have to do a little fiddling.
I used HTMLDoc a couple of years ago and had pretty good luck with it.
try wkhtmltopdf. It is a command line utility that can be provided an html file or web address and a save location for the pdf. Very easy to use and utilizes the same rendering engine as safari. Works MUCH better than many of the other parsers that I have used (that don't always support CSS and other advanced layout features.
Take a look at html2ps (Perl) or html2ps (PHP). However, none of the two is implemented in Java.
You might also want to read this article.
flying saucer library is the best one to use. It works on top of itext and makes the task of conversion very easy.
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
This post was edited and submitted for review 11 months ago and failed to reopen the post:
Original close reason(s) were not resolved
Improve this question
I was wondering if there exists any Java library that contains all HTML tags. I am writing selenium tests for fairly complex web sites using the Java binding, and often needing to find an element by tag name. I thought having a class with constants referring to each tag name would be nice. Since there is a finite list of HTML tags, I'm thinking this must already exist. I could begin writing mine, of course, but why reinvent the wheel if there is one out there. I have checked the Selenium Java API documentation but can't find any. Any suggestions?
No, I do not believe such a library is currently available.
Although there are a finite number of STANDARD tags in html, there is also the ability to have USER DEFINED tags. There are also different versions of HTML (current is HTML5) that support many different tags For example the tag is no longer supported in HTML5, but does exist in older versions of HTML. These two factors may make it increasingly difficult to create a definitive library of all tags.
The best option would probably be to create your own, personalized library for the project.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I've been searching high and low for an up to date solution to this age old problem.
Long story short I want to take css + html -> pdf and do it in java.
I don't want to use an API as the data is sensitive. Googling provides me with countless sites/services that offer to do this but I'm looking for a stand alone tool and looking for one that will work nicely from my java server. I've found this awesome looking command line tool but it's a command line tool and spawning processes off a web server starts to get sketchy IMO (but I'm always willing to hear otherwise). Additionally flying saucer seems to be a standard choice, but I've heard mixed reviews.
Here is a 5 year old question on the subject, but I figure things have changed! Especially with all the work being done in the area of front end unit testing with dom manipulation I figure there might be some less than conventional solutions and I'm willing to hear them all!
Any help would be greatly appreciated.
You might try a combination CSSBox that converts HTML+CSS to SVG and then use for example Batik for creating your PDF as proposed for example here. FlyingSaucer could also do the job.
The choice depends on your further requirements. E.g. are you processing "street HTML" or well-formed documents? What about the pages in the resulting PDF? What about interactive elements in the HTML pages?
I mean the only way is to try at least some options practically and then you may ask more specific questions about some particular problems.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I am developing a JSF project and I have a doubt about reporting.
The idea is to offer the users reports in both HTML and PDF formats.
This should work developing the reports in HTML+CSS+JS and whenever a user needs a PDF report just convert the HMTL+CSS+JS to PDF.
Does somebody know a free Java library for converting the HTML to PDF?
This should be blind to the user.
Other proposals are accepted.
Thanks in advance.
better to use wkhtmltopdf tool to convert your HTML to pdf
Free solution: wkhtmltopdf - uses WebKit under the hood.
Commercial solution: PrinceXML - uses it's own ACID 2 compliant HTML rendering engine.
Apache FOP would be one solution which is an XSLT based solution although it does not support HTML5. Flying Saucer, wkhtmltopdf are some free solutions which are worthy a try. Commercial libraries like PriceXML offer support to CSS3. Pdfcrowd is yet another commercial solution.
Would Jasper Reports be an option? From the same report file you can generate many formats, PDF and HTML (+CSS) are two of them. Plus there is a GUI report designer.
Try out Flying Saucer
It internally uses iText and pretty good library
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
Improve this question
I have to produce a report on all of my program's classes and methods and put it into a word document. Now, I really want to know if there is a software that will generate a text file documentation from my project files without inserting comments to source codes. I just want a list of all methods and classes in a text or ms word file, so that I can fill in the description on my own.
You can generate javadoc documentation just from uncommented source code. It will generate HTML, but there are probably converters to Word available.
However, I would strongly recommend that you add comments to your code instead. It's what Java programmers the world over expect; the documentation will show up in tooltips when you're writing new code calling into your current API; the tooling is geared up for it. Basically, try to work with the language conventions instead of fighting them.
EDIT: It sounds like you can use a doclet to generate the Word document for you. The MIF Doclet may be a good starting point, or PDFDoclet.
Generate the documentation using javadoc and then convert it to the required format. Look for different options here: https://www.oracle.com/java/technologies/javase/javadoc-faq.html#print.
Hope it helps.
There is a Maven plugin, "maven-site-plugin" that is useful for producing editable HTML docs from a Java project.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I need to create a webpage quite similar to Google's great Docs spreadsheet, but in my case I cannot use their's.
Also there is no need to have the full feature set of the Google Docs spreadsheet (which is really big!).
But my minimal feature set is:
- change, add, delete cells and content
- change of formats like color, size, font
- the functions sum(), avg(), count()
My preferred tools are JSP, tomcat, JQuery. The server representation does not matter and could be any of xml, text, database tables or s.th. else.
I am quite sure, that there are perfect open solutions out there - which I can use to start - to fit my requirements but my problem is to find them.
Searching for "Google spreadsheet alternative" did not work very well.
Any hint or link is appreciated.
Thank you.
Alex
Take a look at primefaces sheet. If you like jQuery and use JSP, you should consider learning JSF and use primefaces since primefaces already heavily uses jQuery, meaning if you have to personalize the behavior of its controls, you are already presented with a familiar interface.
Primefaces sheet seems to provide what you're looking for, which is to say, something similar to an excel sheet.