Xportability / css-to-pdf

Convert any HTML page or region to PDF - supports CSS, SVG, embedded XML objects, and more..
http://www.cloudformatter.com/CSS2Pdf
207 stars 77 forks source link

css boostrap not loaded while export to pdf #45

Closed Zeltron closed 8 years ago

Zeltron commented 8 years ago

Are this method can be used to import/load css boostrap ?

onclick="return xepOnline.Formatter.Format('printme',{render:'download'},{pageMediaResource:'../styles/vendor/bootstrap.min.css'},{pageMediaResource:'../scripts/vendor/bootstrap/bootstrap.js'});"

kbrown01 commented 8 years ago

I do not understand the question. Certainly bootstrap CSS (except some of the print media rules) if loaded on your page would be available in the print out. The whole @cloudformatter website uses bootstrap.

Zeltron commented 8 years ago

Sorry if you don't understand what i'm asking ... i'm trying to using this library with angular, by using ng-click . but when i export to PDF the CSS is mess up likes it not taking the CSS bootstrap . In the system the html page is arrange properly using the CSS bootstrap

*The css load properly in my html page , but when export to PDF it not load properly

This how i'm calling the xepOnline in controller :

$scope.exportResume = function(){ console.log("export"); return xepOnline.Formatter.Format('printme', {render:'download'}); };

kbrown01 commented 8 years ago

You have to set up a fiddle to understand. When that Javascript is run, it walks the div (or div's) in question and copies the exact content and resolved css to another div. To me, it sounds as if your page is not loaded or the result of the "click" is not finished.

Zeltron commented 8 years ago

kbrown01 , the issue is solved . It is because of the structure of my html is not well organized. Thank you .

By the way i'm have some doubt regarding this library:

  1. Are this library dependency with these three services ? if the services is down then we unable to export/print right ?

xep_chandra_service: 'https://xep.cloudformatter.com/Chandra.svc/genpackage' xep_chandra_service_AS_PDF: 'https://xep.cloudformatter.com/Chandra.svc/genfile' xep_chandra_service_page_images: 'https://xep.cloudformatter.com/Chandra.svc/genpageimages'

  1. Are this library need internet connections ? if no internet connections it won't work ?
  2. Can i download the 3 services , to insert in my local ?

Please advice.

kbrown01 commented 8 years ago

It depends on any one of the three -- they are used for different ways of formatting. Of course the solution depends on them as it is a remote formatting service. You cannot download the remote service, it is not free -- only free to use.