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

PDF Export - Images missing

1 Answer 115 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Michael
Top achievements
Rank 1
Michael asked on 15 Jun 2015, 10:22 AM

Hi - I have the following Grid with Images:

@(Html.Kendo().Grid<MvcApplication.Models.Articles>()
.Name("gridSelectedArticles")
.DataSource(dataSource => dataSource // Configure the grid data source
    .Ajax() // Specify that ajax binding is used
    //.Read(read => read.Action("Articles_Read", "Parts").Data("additionalInfo")) // Set the action method which will return the data in JSON format
    .ServerOperation(false)
    .PageSize(5)
    .Aggregates(a => a.Add(c => c.Price).Sum())
    )
.AutoBind(false)
.Columns(columns =>
{
    columns.Bound(a => a.StockCode).Title("Artikelnummer");
    columns.Bound(a => a.ImageUrl).ClientTemplate("<img src='#=ImageUrl#' alt='#=StockCode #' title='#=StockCode #' width='55' />").Title("Bild");
    columns.Bound(a => a.StockBalance).Title("Lagerbestand");
    columns.Bound(a => a.Price).Title("Preis").Format("{0:C}")
        .ClientFooterTemplate("Total #= kendo.toString(sum, 'C')#");
})
.Pageable() // Enable paging
.Sortable() // Enable sorting
.Selectable(n => n.Mode(GridSelectionMode.Single))
.ToolBar(tools => tools.Pdf())
.Pdf(pdf => pdf
    .AllPages()
    .FileName("Kendo UI Grid Export.pdf")
    .ProxyURL(Url.Action("Pdf_Export_Save", "Parts"))
    )
//.Events(e => e.DataBound("fDataChanged"))
)

When I export to PDF, the Images are missing in the PDF File.

Images in the Sample here
http://demos.telerik.com/kendo-ui/grid/pdf-export

are exported though. What am I doing wrong?

Thank you.

 

1 Answer, 1 is accepted

Sort by
0
Accepted
T. Tsonev
Telerik team
answered on 17 Jun 2015, 12:15 PM
Hello,

The PDF export module might not be able to export images hosted on a different domain. See Known Limitations.
Setting up permissive Cross-Origin HTTP headers should help in this case.

I hope this helps.

Regards,
T. Tsonev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Grid
Asked by
Michael
Top achievements
Rank 1
Answers by
T. Tsonev
Telerik team
Share this question
or