function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Harvin VincentHarvin Vincent 

Image is not displayed - while displaying PDF Content from SAP webservice

We have integrated with our SAP environment using web service. The SAP webservice returns PDF content which includes image. By using visual force page, the PDF is displayed.
(i)  The PDF content is displayed properly
(ii) The image is not displayed in the PDF

In the visual force page, the PDF rendered by using this contentType="application/pdf". Please let me know any charset to be used to display the image.

Can anyone have idea to display the image in the PDF? 

Thanks,
Harvin



 
Best Answer chosen by Harvin Vincent
Harvin VincentHarvin Vincent
I resolved this issue by a workaround. The webservice returns the binary content. Using the HttpResponse.getBodyAsBlob() method, stored the response as an attachment.

While opening the attachment, the image is displayed properly.

Thanks,
Harvin 

All Answers

Navee RahulNavee Rahul
Hello harvin,

basic mistake would be the path 

<apex:image id="theImage" value="/img/myimage.gif" width="220" height="55"/>

<apex:image id="theImage" value="{!$Resource.myResourceImage}" width="200" height="200"/>

check them.


Thanks
D Naveen Rahul
Harvin VincentHarvin Vincent
Hi Naveen,

Thanks for your reply. But here the issue the webservice returns binary pdf content. But the pdf content displayed properly but not image. Image is embedded in the PDF content.

Thanks,
Harvin
Harvin VincentHarvin Vincent
I resolved this issue by a workaround. The webservice returns the binary content. Using the HttpResponse.getBodyAsBlob() method, stored the response as an attachment.

While opening the attachment, the image is displayed properly.

Thanks,
Harvin 
This was selected as the best answer