django-wkhtmltopdf | Django Wrapper to the PDF Renderer : wkhtmltopdf | Document Editor library
kandi X-RAY | django-wkhtmltopdf Summary
kandi X-RAY | django-wkhtmltopdf Summary
Django Wrapper to the PDF Renderer: wkhtmltopdf
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Render the PDF document
- Wrapper around wkhtmltopdf
- Render a single page PDF file
- Convert options to arguments
- Convert a file to a PDF
- Set the filename
- Quotes a string
- Returns a Content - Disposition filename
django-wkhtmltopdf Key Features
django-wkhtmltopdf Examples and Code Snippets
Community Discussions
Trending Discussions on django-wkhtmltopdf
QUESTION
same issue. Just checking if it has been solved. More context: I'm using django-wkhtmltopdf 3.3.0 and wkhtmltopdf 0.12.5 (with patched qt) on ubuntu.
...ANSWER
Answered 2021-May-01 at 15:14Seems the problem is from static files loading.
wkhtmltopdf tries loading the static files from "localhost:8000/static" but that port is already busy, awaiting to respond to the query calling wkhtmltopdf. Some sort of mutual exclusion.
Edit: I fixed this by adding moving the static files to an nginx server on port 8081, and serving them from there.
QUESTION
What I'm trying to implement is this:
- User sends query parameters from React FE microservice to the Django BE microservice.
- URI is something like
/api/reports?startingPage=12&dataView=Region
- These PDFs are way too big to be generated in FE, so doing it server side
- URI is something like
- Request makes its way into the
view.py
where the data related todataView=Region
is queried from the database, each row is iterated through and a PDF report is generated for each item- Each
dataView=Region
can consist of a few hundred items and each of those items is its own report that can be a page long or several pages long
- Each
- As the reports are generated, they should be saved to the server persistent volume claim and not be sent back to FE until they have all run.
- When they have all run, I plan to use
pypdf2
to combine all of the PDFs into one large file. - At that point, the file is sent back to the FE to download.
I'm only working on 1. and 3. at this point and I'm unable to:
- Get the files to save to storage
- Prevent the default behavior of the PDF being sent back to the FE after it has been generated
The PDFs are being generated, so that is good.
I'm trying to implement the suggestions as found here, but I'm not getting the desired results:
Save pdf from django-wkhtmltopdf to server (instead of returning as a response)
This is what I currently have on the Django side:
...ANSWER
Answered 2020-Aug-21 at 16:47OK, my smooth brain gained a few ripples overnight and figured it out this morning:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install django-wkhtmltopdf
You can use django-wkhtmltopdf 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