所有其他格式(png,tiff,gif)都可以使用! 只有jpeg/jpg不起作用。无法将jpeg添加到PDF
当我运行代码时,我接受在给定位置看pdf中的图像。所有的格式工作正常。我能够看到图像。但是当我从流中读取一个.jpeg/jpg图像时,图像所在的区域是空白的。
没有引发异常。
代码执行得很好。
只是图像不位于在PDF
我使用这个版本pdfsharp的:1.32.3057.0
这里是我使用的代码:
AmazonS3Client client;
using (client = new AmazonS3Client(accessKey, secretKey))
{
GetObjectRequest request = new GetObjectRequest
{
BucketName = bucket,
Key = //File Location
using (GetObjectResponse response = client.GetObject(request))
{
Image imgFromStream = Image.FromStream(response.ResponseStream, true, true);
XImage image = XImage.FromGdiPlusImage(imgFromStream);
gfx.DrawImage(image, layoutItem.Left, layoutItem.Top, image.PointWidth, image.PointHeight);
}
}
你可以详细说明你的代码“不起作用”吗?你在期待什么,究竟发生了什么?如果您遇到异常,请发布它发生的行和异常详细信息。 – gunr2171
哇!好的!让我再试一次。你说得对@walther。 – jmogera
@ gunr2171如果提供了正确的信息,请让我来。 – jmogera