1

好的,问题来了:

  • 矢量图形的格式可以是 SWF 或 SVG,由我选择
  • 文本可以有任何字体
  • 文本和图形都可以旋转和移动,图形也可以缩放

我考虑在客户端,即 flash player 9,使用alivePDF,但 1. 它不支持许多字体,2. 代码确实有点单一且非结构化,所以我没有真正的线索,从哪里开始破解在我自己...

所以我想,也许在服务器端这样做......所以我的问题是,有没有人知道库/工具,这使得这以一种简单的方式可行?我真的不想解析遍历矢量图形并将它们自己绘制到PDF中......

问候

back2dos

4

3 回答 3

3

iText 库(Java,但已被移植到许多地方,包括一个名为 iTextSharp 的 .NET 端口)具有在它生成的 PDF 中包含 SVG 的功能。Manning 也有一本非常好的关于 iText 的书。

于 2009-08-06T14:02:50.223 回答
2

ok, iText was a good pointer, and i am sure, this lib can do ANYTHING i want to ... but i'm too lazy for that ... :)

there is a stupid simple solution however: have the graphics on the server as SVGs, convert them to SWFs for the client (with swfmill) ... and for rendering the PDF, use transformation data sent from client, as well as texts/graphics ids to compose a new SVG ... and then SVG2PDF it with a decent tool ...

greetz

back2dos

于 2009-08-11T09:02:42.657 回答
2

reportlab (python) + svglib 或 svglib 本身应该做你想做的事

于 2009-08-11T09:14:08.827 回答