Creating PDF files with page layouts using CSS [closed]
Questions asking us to recommend or find a tool, library or favorite off-site resour开发者_StackOverflowce are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this questionI am searching a system which allows me to generate PDF files from html. I would like to use as much CSS for styling as possible.
Features that would be great:
- Repetition of certain elements on each page (header / footer)
- The system should know the number of pages of the generated pdf, so I can insert something like this: page 1 of 5, page 2 of 5, page 3 of 5, etc..
- CSS2 / CSS3 would be great for styling
- Automatic recognition of line breaks
Which software / system / service could be recommended to use html/css for the automatic generation of pdf-files?
It does nos matter if the system is free or commercial. But what does matter to me, that it should be possible to ship the system with an existing software. So if it is commercail ,there should be a possibility to include it into a software stack.
I don't know if it does exactly what you want, but Prince XML can help you make PDFs with HTML, XML and CSS.
edit: I got this from it's features page:
- Page headers/footers page numbering and duplex printing.
- Tables with automatic layout and running headers/footers.
- Multi-column layout, floats and positioned blocks.
- Lists with customisable bullets or numbers.
- Automatic numbering of lists, headings, sections or figures.
- Footnotes, cross-references.
I use ABCPDF to generate web content as PDF files.
You should take a look at:
- iText
- Flying Saucer (a wrapper around iText)
The iText library has Java and C# versions.
Have a look at this post, which I wrote a couple of months ago. It does a perfect conversion and is optimised for use on the server. Works with any Web Services capable client (Java, .net, etc)
Have look at WeasyPrint. Like other tools proposed here, it turns HTML/CSS documents into PDF.
This one is open-source. (I’m the developer.)
WebToPDF.NET converts HTML/CSS to PDF. It is a commercial .NET library consisting of a single 100% managed assembly.
Disclosure: I am affiliated with TallComponents, the vendor of this component
精彩评论