• Grails 使用Flying Saucer生成PDF


    > 要在Java web/Grails中导出PDF,目前网上能找到的最好方案就是使用[flyingsaucer](https://github.com/flyingsaucerproject/flyingsaucer "Flying Saucer")库。 > 网上能找到现成的v8版本的jar包总有各种问题,比如css中`word-wrap`不起作用等等的bug, > 我们需要到项目的git主页下载所有源码并用**maven**编译。 编译源码 === 将源码中`flying-saucer-pdf`工程源码目录下的`pdf`文件夹整个复制到`flying-saucer-core`的源码目录下; 修改`flying-saucer-pdf`工程的`pom.xml`文件,将`com.lowagie.itext`包加入编译依赖: xml: 4.0.0 org.xhtmlrenderer 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 在`flying-saucer-pdf`工程目录下maven编译: `mvn package` ,最终会生成包含pdf渲染类的jar包。 接下来的工作就请移步这里 [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
  • 相关阅读:
    268. Missing Number
    217. Contains Duplicate
    189. Rotate Array
    Two Sum II
    122. Best Time to Buy and Sell Stock II
    169. Majority Element
    C# ConfigurationManager不存在问题解决
    C# sqlhelper
    C#基础
    数据库事务日志已满的解决办法
  • 原文地址:https://www.cnblogs.com/hangxin1940/p/2808097.html
Copyright © 2020-2023  润新知