如何使用C#和iTextSharp的,以增加图像的PDF文件?如何使用、图像、文件、iTextSharp

2023-09-06 09:43:04 作者:橱窗里的猫

我需要你们的帮助,添加图像到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.

 
精彩推荐
图片推荐