This is a migrated thread and some comments may be shown as answers.

How to add an image to PDF export

3 Answers 103 Views
Grid
This is a migrated thread and some comments may be shown as answers.
leo
Top achievements
Rank 1
leo asked on 13 Jul 2014, 07:29 AM
I would like to add an image (stored in DB) to my PDF export. Now I am exporting PDF using:



grdiView1.MasterTableView.ExportToPdf();



I just want to add a single image to this pdf file from the database. Image will be outside the gridview lets say at the top left of the pdf file....



I hope somebody can help me with this...

3 Answers, 1 is accepted

Sort by
0
SANJAY
Top achievements
Rank 1
answered on 13 Jul 2014, 12:57 PM
Hi Leo

To the best of my understanding you would not be able to get the image on the PDF through the export function of the Grid

Option 1) Please try if you can get the image in row 1 of the grid and then export

Option 2) Export the PDF then edit using itextsharp and then you could comfortably put the image at which ever location either before the grid or after the grid

Regards
0
Mehmet
Top achievements
Rank 1
answered on 14 Jul 2014, 01:00 AM
any ideas why could this error come up ?

Invalid XHTML. RadGrid has to render correct XHTML in order to export to PDF.

thank you
0
Kostadin
Telerik team
answered on 16 Jul 2014, 02:02 PM
Hi Mehmet,

You could check out the following live example which demonstrates how to add an image in the header of the PDF page. Keep in mind that only images with relative and absolute path could be exported. Note that the binary image could will not be included in the exported document.

Regards,
Kostadin
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Grid
Asked by
leo
Top achievements
Rank 1
Answers by
SANJAY
Top achievements
Rank 1
Mehmet
Top achievements
Rank 1
Kostadin
Telerik team
Share this question
or