Grails uses flying saucer to generate a PDF file

Source: Internet
Author: User
Tags grails
> To export PDF in Java Web/grails, the best solution on the Internet is to use the [flyingsaucer] (https://github.com/flyingsaucerproject/flyingsaucer "flying saucer") Library.
> There are always various problems that can be found on the Internet with the ready-made V8 jar packages, such as bugs in CSS that 'word-wrapp' does not work,
> We need to download all the source code from the GIT homepage of the project and compile it with ** Maven.

Compile source code
===
Copy the 'pdf 'folder in the 'Flying-saucer-PDF' project source code directory to the source code directory of 'flying-saucer-core;

Modify the 'pom. xml' file of the 'Flying-saucer-PDF 'project and add the 'com. lowagie. itext' package to the compilation dependency:

XML:

4.0.0 Org.xhtml Renderer Flying-saucer-parent 9.0.2-Snapshot Flying-saucer-core Flying saucer is a CSS 2.1 Renderer written in Java. This artifact contains the core rendering and layout code as well as java2d output. Com. lowagie Itext 2.1.7 Jar Flying saucer core Renderer

In the 'Flying-saucer-PDF 'project directory, Maven Compilation: 'mvn Package' will generate a jar package containing the PDF rendering class.

next step here [insanely simple PDFs for grails
] (http://blogs.bytecode.com.au/glen/2007/12/17/gravl-insanely-simple-pdfs-for-grails.html "") http://blogs.bytecode.com.au/glen/2007/12/17/gravl-insanely-simple-pdfs-for-grails.html

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.