1

当我将本机 Dynamics AX 2009 报告保存为 pdf 或 pdf 嵌入时,它不会正确显示报告中的图像,即标题部分中的公司徽标。图像非常扭曲、发灰和重复。

另一方面,如果我以 HTML 格式导出图像,图像会正确显示。有没有人遇到过类似的问题。

请注意,当报告打印对话框打开时,我使用“文件”选项将报告保存为 pdf。

任何帮助将不胜感激。

4

2 回答 2

0
如果使用的图像格式是以下之一,则会出现问题
1. 24位位图
2. TIFF
于 2012-09-15T12:08:33.070 回答
0

我在 AX 2009 中找到了解决此问题的方法:

Bitmap getImageBitmap(ItemId _itemId)
{
    HPLInventImages inventImages; // Column HPLInventImages.ItemImage is EDT:BlobData (which is a container)
    Image image;
    ;

    if (!_itemId) return inventImages.ItemImage; // Return null bitmap. The whole AX client crashes if you try to do the resizing code below on a null bitmap.

    select firstonly inventImages where inventImages.ItemId==_itemId;
    //return inventImages.ItemImage; // Would normally just do this, but see comments below.

    // Ok, this next bit is weird!
    // There is a known issue with AX reports with images in, getting saved as PDFs:
    // In some cases, the images appear as garbage on the PDF.
    // I have found that resizing the image before rendering it, causes the image to come out ok on the PDF.
    // So the code below does a token resize (by 1.0 times!) operation on the image before returning it.
    // That is enough to make the image on the PDF turn out ok.
    image=new Image(inventImages.ItemImage);
    image.resize(image.width()*1.0,image.height()*1.0,InterpolationMode::InterpolationModeHighQuality);
    return image.getData();
}
于 2016-11-08T09:34:22.843 回答