hearsid / ng-html-to-pdf-save Goto Github PK
View Code? Open in Web Editor NEWSave HTML as pdf file on the browser with angularjs .
Save HTML as pdf file on the browser with angularjs .
First, on safari it generates blank page only.
Chrome/Firefox it generates .... something but its not very good looking. Page is all messed up in terms of columns/images/text all over the place.
Simple stuff like the demo, which is only text works ok.
No worries though, thanks for putting this together! Pretty cool idea.
Hi,
I'm using this directive and it works properly, however my layout is to print as landscape. There is a property do make the PDF landscape?
Kind regards.
When i try tu run bower install angular-save-html-to-pdf i get this error:
_
bower canvg#1.5.3 ENORESTARGET No tag found that was able to satisfy 1.5.3_
but if i install canvg separatelly : bower install canvg its installation success with version canvg#1.3.0
What can i do?? im using angular version: "angular": "~1.6.0"
On more than one page, only the first one has information, the next, are left blank.
When I try to create a PDF from a bootstrap table, it does create the PDF file. However, I'm getting three issues:
The background color of the table is black (on my browser is white). I wonder if this can be an issue with Bootstrap's CSS and html2canvas too.
Table's length is greater than 1 page, but instead of creating another page, it cut's off the bottom of the table.
Also it does not respect the pdf-name tag, the downloaded file is named "chart-reports.pdf".
My jade's template looks like:
button(pdf-save-button="main", pdf-name="test.pdf", class="btn btn-primary") download
div(pdf-save-content="main")
table(class="table table-bordered table-condensed")
tbody
tr
td(rowspan="4", colspan="2")
img(class="center-block", src="/images/logo.png")
td(colspan="4") Report
tr
td Col 1
td Col 2
td(colspan="2") Col 3
And the javascript:
script(src='bower_components/angular/angular.min.js')
script(src='bower_components/moment/moment.js')
script(src='bower_components/angular-moment/angular-moment.min.js')
script(src='bower_components/angular-animate/angular-animate.min.js')
script(src='bower_components/angular-bootstrap/ui-bootstrap-tpls.min.js')
script(src='bower_components/jquery/dist/jquery.min.js')
script(src='https://cdn.rawgit.com/niklasvh/html2canvas/0.5.0-alpha2/dist/html2canvas.min.js')
script(src='bower_components/jsPDF/dist/jspdf.debug.js')
script(src='bower_components/angular-save-html-to-pdf/dist/saveHtmlToPdf.min.js')
When I install using bower bower install angular-save-html-to-pdf
dist folder appeared to be missing?
help please?
HI devs!!! :) i would like to ask you one thing: i cannot save my html in a pdf with this library. I think that there's a problem in createPDF() function, because after that getCanvas() function is done, the promise in then is broken because it doesn't create pdf or execute the function inside .then either.
UPDATE: i've modified a little bit the library and put error condition in resolve, so it logs me "CanvasRenderer is not defined". I googled a bit and i've found that maybe it's a jspdf version problem.
UPDATE 2: i have to put jspdf.debug.js and all works! but there's problem with pdfs with more than one page and quality. If you don't mind, can i make pull request? :)
The PDF file being generated by the directive does not open on adobe acrobat or a nitro pdf etc. It opens up in the browser (i am using chrome) but shows an error when opening in abode acrobat for e.g. that the file corrupt. I tried changing the directive using but I was only able to go so far as to print the unformatted text.
Uncaught (in promise) TypeError: Cannot read property 'clientHeight' of undefined
at Object.onrendered (saveHtmlToPdf.min.js:1)
at jspdf.debug.js:13681
onrendered @ saveHtmlToPdf.min.js:1
(anonymous) @ jspdf.debug.js:13681
I have a fairly large HTML block - enough to cover multiple PDF pages.
When implementing ng-html-to-pdf-save, the PDF only saves one page - therefore the HTML block gets cut off.
Is there a way to allow multi-page PDFs?
I found a big bug in this module but unfortunately i still couldn't solve it. would u plz to help me on this bug issue. i also asked question on Stackoverflow but still haven't gotten any answer
here is my question:
Hi! When I try to use the plugin the file "index.js" is not found, I think line 4 of the bower.json is incorrect and should be:
"main": "./dist/saveHtmlToPdf.js",
THis librbay is quite bably broken if I wanted to use multipage LARGE div's of any type, I I wrote a simple GIST to suit my needs: https://gist.github.com/vimes1984/b6557f2b48fef3a6b6cbe6e30876cebf
I hope it helps someone that stumbles across this...
It will do HTML-> PNG -> PDF.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.