django-pdf | pompous mission | Document Editor library
kandi X-RAY | django-pdf Summary
kandi X-RAY | django-pdf Summary
django-pdf despite its simplicity has the pompous mission of automagically converting on-the-fly views' HTML output to PDF --without modifying your views.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Transform the response data
- Transform response to PDF
django-pdf Key Features
django-pdf Examples and Code Snippets
Community Discussions
Trending Discussions on django-pdf
QUESTION
I'm working on a Django project where we generate PDF files from HTML template. I use django-pdfkit
to render PDF.
On my Ubuntu 16.04
everything works correctly but when I deploy the project on DigitalOcean Ubuntu 16.04 server, it raises error:
IOError at /render/doklad/ wkhtmltopdf exited with non-zero code -6. error:
QXcbConnection: Could not connect to display
I tried to install
sudo apt-get install libxrender1 fontconfig xvfb
Set WKHTMLTOPDF_BIN
variable to correct path.
Changed gunicorn
user to root.
ANSWER
Answered 2017-Aug-24 at 21:54Are you running your commmand through xvfb-run
?
In your calling code you may need to replace straight-up calls to wkhtmltopdf
with something more like this:
QUESTION
I'm trying to use PDFView
from django-pdfkit
. The problem is that I don't have one template. Instead I have 4 templates. The template chosen depends on request.GET parameter.
So I've created a View
called Test which extends PDFView
.
ANSWER
Answered 2017-Aug-15 at 11:14By overriding get
, you've bypassed all the built-in functionality for that view, including the calling of get_template_names
. This is very rarely the right thing to do.
However, given the code you've shown, what's the reason why you can't call that method yourself from render_html
? Or just inline the logic there.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install django-pdf
You can use django-pdf like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page