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

kendo export as pdf

4 Answers 767 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Nitin
Top achievements
Rank 1
Nitin asked on 28 May 2018, 12:54 PM

hi, 

    while creating Div content as export to PDF , intermediate blank pdf creation is happening

want to know the issue and solution for that.

4 Answers, 1 is accepted

Sort by
0
Nitin
Top achievements
Rank 1
answered on 28 May 2018, 12:55 PM
here the base64 data of Div passing to php file to create the pdf file , please let me know the solution 
0
Svet
Telerik team
answered on 30 May 2018, 07:42 AM
Hi Nitin,

Could you provide some more details about the use case scenario, so that we are able to reproduce the reported undesired behavior of creating a blank pdf.

I am also sending some links that may be useful for this case:

The following shows the API of the saveAs method of the FileSaver (it uses Base64-encoded Data URI for its data parameter):

https://www.telerik.com/kendo-angular-ui/components/filesaver/api/saveAs/

the PDF Export component:

https://www.telerik.com/kendo-angular-ui/components/pdfexport/

and the export to pdf functionality of the grid:

https://www.telerik.com/kendo-angular-ui/components/grid/export/pdf-export/

I hope this information will be helpful.

Regards,
Svetlin
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Nitin
Top achievements
Rank 1
answered on 04 Jul 2018, 04:41 AM

hi Svetlin,

 I'm using Angular 1 version with kendo plugin to export as PDF.

The useful likn which u given is about angular 2/4.

The use case is for the perticular account 1st time creation & export pdf report getting blank pages

where as followed by one more time if we try to create the pdf then it is working fine.

 

below is the sample code to create the PDF of Div section :

kendo.drawing.drawDOM("#content_mergeReport", {
            allPages: true,
            forcePageBreak: ".page-break",
            paperSize: "A4",
            scale: 0.6,
             landscape: false,
            Portrait :true,
            repeatHeaders: true,
            multiPage: 'true',
            margin: {left: "1cm", top: "1.5cm", right: "1cm", bottom: "2.5cm" },
              
            /*template: $("#page-template").html()*/
               template: kendo.template($("#page-template").html())(
                {
                    pageNum: "",
                    totalPages: "",
                    FIRSTDATE: startDate1,
                    TYPE: typeofuser,
                    ENDDATE: endDate1,
                    USER: context.get('practicedetails').Name,
                   
                })
}).then(function (group) {
      return kendo.drawing.exportPDF(group, {
   });

})

 

Regards,

Nitin 

0
Ivan Danchev
Telerik team
answered on 05 Jul 2018, 03:07 PM
Hi Nitin,

Here's a dojo example in which a Grid's content is exported with Drawing. The base64 encoded file content is sent to the proxy by the kendo.saveAs method:
kendo.saveAs({
  //base64-encoded dataURI:
  dataURI: data,
  fileName: "Test.pdf",
});

More details on the parameters of this method you can find in its API documentation.

Regards,
Ivan Danchev
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
General Discussions
Asked by
Nitin
Top achievements
Rank 1
Answers by
Nitin
Top achievements
Rank 1
Svet
Telerik team
Ivan Danchev
Telerik team
Share this question
or