-1

When I pass the angular generated html to the jspdf, in that case angular classes like ng-hide not affect the generated pdf. So generated pdf contains the elements that are under the ng-hide class.

Please go through the JS bin attached, http://jsbin.com/lemewu/edit?html,js,output

I am using following cdnjs https://cdnjs.cloudflare.com/ajax/libs/jspdf/1.2.61/jspdf.debug.js

Roshan
  • 1
  • 1

1 Answers1

0

Hope this helps. You are using ng-hide wrong. There is difference between using ng-hide and ng-if. Please go through that. working link

Pradeepb
  • 2,564
  • 3
  • 25
  • 46
  • Thanks for quick reply Pradeepb, But I am using third party library which generate the html that need to rendered. So can't modify the ng-hide tag. Can we have any other way to do so. – Roshan Sep 17 '16 at 13:54
  • Problem is "ng-hide" shows or hides the given HTML element. It wont remove the elements from HTML markup. Thats the reason when generating PDF, its still visible. – Pradeepb Sep 17 '16 at 14:02
  • Thanks again Pradeepb. My goal is to get the pdf of rendered element only. And currently by passing angular contain html to jspdf not work for me. To solve this I uses the html2canvas(To generate image) and jspdf(generate the pdf from image) combination. But it cuts the element while pagination. So do you have any solution which completes my goal. – Roshan Sep 17 '16 at 14:09
  • Sorry Roshan. I have no idea regarding this. – Pradeepb Sep 17 '16 at 14:10