AnsweredAssumed Answered

How can I embed an image from a record's image field on a custom PDF?

Question asked by Usman Saeed on Apr 1, 2014
Latest reply on Aug 19, 2015 by Mubashar Ali
Hi All,

I am generating a custom pdf template from a custom module in Sugar Pro 7.1.6.
I am stuck in one thing ie. image addition to the pdf template generated.
My image tag is like this:
<img src="rest/v10/Quotations/62e62c83-0d4d-0acb-b69b-5337b8ecc605/file/main_photo?format=sugar-html-json&amp;platform=base" class="" width= "{$main_image_width}" height= "{$main_image_height}" />

If I use this in the browser it shows the image.
But when I am using this in my pdf template it through th error: TCPDF ERROR: [Image] No such file or directory in ....

The image is there in upload/62e62c83-0d4d-0acb-b69b-5337b8ecc605.

Can any body tell me what I am doing wrong? Is this the image path or I have to include some library as well....

Will appreciate your thoughts on this.

Thank you, 

Usman

Outcomes