2012-07-09 64 views
1

当我将原生Dynamics AX 2009报告保存为pdf或pdf嵌入式版本时,它无法正确显示报告中的图像,即公司徽标。图像变得非常扭曲,灰暗和重复。Dynamics AX 2009中的图像显示问题保存为pdf

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

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

任何帮助将不胜感激。

+0

请注明您所使用的图像格式。 我有这个相同的问题,但没有进一步调查问题。 – 2012-07-10 14:02:36

+0

我使用JPEG图像格式 – 2012-09-15 07:15:04

回答

0
 
Issue will go if the image format used is one of the following 
1. 24bit Bitmap 
2. TIFF 
0

我发现这个问题的解决方案在2009年AX:

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(); 
}