如何使用C#和iTextSharp的,以增加图像的PDF文件? [英] How to Add image in pdf using C# and iTextSharp?

查看:201
本文介绍了如何使用C#和iTextSharp的,以增加图像的PDF文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要你们的帮助,添加图像到PDF。

I need your help adding an image to a PDF.

我使用的是:

string imgPath2 = localPath + "\\TempChartImages\\" + LegendPath;
img2.Save(imgPath2);
ith.WriteImage(imgPath2, 80);

但是,这code给我的错误:

But this code gives me the error:

使用未分配的局部变量IMG2的

Use of unassigned local variable img2

我该如何解决这个问题?

How can I solve this error?

推荐答案

下面是的iTextSharp的教程图片。如果没有看到您更多的code,这很难判断,从这个哪块的code,你将需要。

Here is the iTextSharp tutorial on images. Without seeing more of your code, it's tough to judge what piece of code from this you'll need.

这篇关于如何使用C#和iTextSharp的,以增加图像的PDF文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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