2012-07-09 65 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(); 
}