在PDF文件C#上绘图 [英] Drawing on PDF file C#

查看:152
本文介绍了在PDF文件C#上绘图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要从WPF应用程序写入PDF文件。
我已经看到了一些第三方库来创建PDF文件,但是找不到任何可以写框的东西或任何形状的东西。
我必须使用.NET的某些2D库还是有提供这种工作类型的PDF库?

I need to write a PDF file from my WPF app. I've seen some 3rd party libraries to create PDF files, but I couldn't find any that would allow me to write boxes, or any shape for the matter. Do I have to use some 2D library from .NET or is there any PDF library that provides that type of work?

这就是我需要绘制的内容:

This is what I need to draw:

我将有一个对象列表 List< ObjX>列表; 我将使用它来填充每个框。
例如,将其视为所有雇员的个人数据列表。

I'll have a list of objects List<ObjX> list; that I'll use to fill each box. Think of it as a Personal Data list of all employees, for instance.

____________________________________
{header_img}

| Name: {name} | Surname: {surname}|

| Address : {address} | City: {cit}|
____________________________________

这是一个非常糟糕的绘图,我要做的是更加详尽的,甚至包括图像。

It's a very poor drawing, what I'll do is a bit more elaborated, including even images.

推荐答案

您可能希望 iTextSharp

通过搜索StackOverflow,您可以找到有关如何使用它的大量帮助。 :)

You can find lots of help on how to use it by searching StackOverflow. :)

这是绘制矩形的答案:在iText pdf中绘制一个矩形

This is an answer to drawing a rectangle: Draw a rectangle in an iText pdf

编辑

此外,对绘制形状iTextSharp的搜索也为我提供了此链接,该链接看起来非常详细。 http://www.mikesdotnetting.com/Article/88/ iTextSharp-Drawing-shapes-andGraphics

Also, a search on "drawing shapes iTextSharp" gave me this link which looks quite detailed. http://www.mikesdotnetting.com/Article/88/iTextSharp-Drawing-shapes-and-Graphics

您需要注意版本之间的差异,因为1.4和1.5完全不同。

You will need to watch out for differences in version, since 1.4 and 1.5 are quite different.

这篇关于在PDF文件C#上绘图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆