Hi Dev,

How you done with the Jspdf. I am unable to open in IE , Bcoz IE blocking 
blob url... 

here my code. viewRiskId is a div element.

converToPdf: function(viewRiskId){
        html2canvas(viewRiskId, {
                onrendered: function (canvas) {
                    var data = canvas.toDataURL("image/jpeg");
                    var doc ;
                    if(canvas.height < canvas.width){
                        doc = new 
jsPDF("l","pt",[canvas.width,canvas.height]);
                    } else{
                    doc = new jsPDF("p","pt",[canvas.height,canvas.width]);
                    }
                    doc.setProperties({
                    title: 'Risk Details',
                    });
                    doc.addImage(data, 'JPEG', 0, 0, canvas.width, 
canvas.height);
                    var blob = doc.output("blob");
                    if (navigator.appVersion.toString().indexOf('.NET') > 
0){
                    var myWindow = window.open();
                        var doc = myWindow.document;
                        doc.open();
                        doc.write( "<link rel=\"stylesheet\" 
href=\"ui/css/style.css\" type=\"text/css\" />" );
                        doc.write( "<link rel=\"stylesheet\" 
href=\"ui/css/bootstrap.min.css\" type=\"text/css\" />" );
                        doc.write( "<link rel=\"stylesheet\" 
href=\"ui/css/fonts.css\" type=\"text/css\" />" );
                        doc.write( "<link rel=\"stylesheet\" 
href=\"ui/css/font-awesome.min.css\" type=\"text/css\" />" );
                        doc.write( "<title>Risk Details</title>" );
                        doc.write(viewRiskId.outerHTML);
                        doc.close();
                } else{
                        window.open(URL.createObjectURL(blob));
                }
                }
            });

On Wednesday, September 23, 2015 at 7:02:05 PM UTC+5:30, Dev Kant kumar 
wrote:
>
> Hi Developer,
>
> I need to export any HTML (Div) to PDF using AngularJs only.
> or can say need to generate PDF using AngularJS.
> I done googling much more but not able to get any solution to generate PDF 
> in angularJs without using JSPDF or phantom and etc.
>
> is there any Directive or events available for PDF generation in AngularJS.
> I am not looking for PDF viewer. I am looking for PDF generation.
>
> I am looking forward to hearing from you ASAP.
>
>
> Thanks in Advance.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Angular" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to