Comments (10)
Apparently phantomjs has a dependency on libfontconfig
.
So you have to install it using apt-get install libfontconfig
.
from node-html-pdf.
As stated on the phantomjs page, there are the following dependencies on centos:
sudo yum install fontconfig freetype libfreetype.so.6 libfontconfig.so.1 libstdc++.so.6
Did that work for you?
I tried to run the unit tests, only the first 5 are passing. It stucks on 'task watch..' I don't really know what to do now to make any progress.
The task watch watches for changes in the filesystem. I think it's the correct behaviour to wait for changes. It will execute the tests again when you edit some files.
from node-html-pdf.
Hi! Will try that asap. Keeping you updated.
from node-html-pdf.
The html I provide seems to be the issue now. Installing the libs fixed the pdf generation (working with one-line html string). Thanks and sorry for the trouble.
from node-html-pdf.
No problem. Thanks for digging into this. I'll update the readme with the dependencies.
Does multiline html not work? I don't have any problem with that.
from node-html-pdf.
No what I meant was that my big chunk of html that I was passing as a string contained something wrong. I tried out of the blue with a <div>trololol</div>
as an input and it worked. I should have just have thought PBKAC instead of 'woot, this library is not working'
from node-html-pdf.
😄 Ok
from node-html-pdf.
I am facing same issue, my html is also correct, everything is ok but it does not work
html-pdf
: 2.1.0
from node-html-pdf.
Increase the timeout value option (Eg.):
var options = { ..., timeout: 30000 };
from node-html-pdf.
I faced the issue recently on Ubuntu 22.04 LTS. Tried almost every solution here and nothing worked. Finally this helped me resolve it.
- Install phantomjs on your local machine (instructions)
- In the
CreateOptions
that you pass topdf.create
, addphantomPath
Here is my updatedCreateOptions
const pdfOptions = {
format: "A4", // allowed units: A3, A4, A5, Legal, Letter, Tabloid
orientation: "portrait", // portrait or landscape
// Rendering options
// base: assetPath, // Base path that's used to load files (images, css, js) when they aren't referenced using a host
localUrlAccess: true, // Prevent local file:// access by passing '--local-url-access=false' to phantomjs
type: "pdf", // allowed file types: png, jpeg, pdf,
phantomPath: "/usr/local/bin/phantomjs", // the local installation of phantomjs (use which phantomjs after step 1 to get this path)
};
from node-html-pdf.
Related Issues (20)
- Text not being displayed on Mac. Working fine on Windows HOT 1
- Custom font not working HOT 1
- How can I make sure table header section should have at least one row.
- Background color not applying those area where no html
- Image not showing when uploaded on vps server
- QR code not visible over generated pdf post ami upgrade HOT 2
- Fonts don't work properly on server HOT 4
- stream (.toStream) not generated after deploying to k8s HOT 2
- The download pdf always have an empty page at last HOT 1
- html-pdf: Unknown Error throw new ERR_INVALID_ARG_TYPE(name, 'string', value); Docker HOT 1
- Pdf saved in TMP directory HOT 1
- Is watermark possible in pdf? HOT 3
- Not able to resize the chebox size while generating the pdf
- Syntax for forcing a page break HOT 2
- Potential injection vulnerability in node-html-pdf
- Page overflow with white line
- PDF Creation Error: spawn /root/pando-app/node_modules/phantomjs-prebuilt/lib/phantom/bin/phantomjs ENOENT HOT 1
- The answer to how to resolve Windows error of phantomjs ENOENT issue
- Error: spawn E2BIG
- error HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-html-pdf.