go-wkhtmltopdf | Golang commandline wrapper for wkhtmltopdf | Document Editor library
kandi X-RAY | go-wkhtmltopdf Summary
kandi X-RAY | go-wkhtmltopdf Summary
Golang commandline wrapper for wkhtmltopdf
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of go-wkhtmltopdf
go-wkhtmltopdf Key Features
go-wkhtmltopdf Examples and Code Snippets
Community Discussions
Trending Discussions on go-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:
QUESTION
i create a service to generate pdf file with go-wkhtmltopdf
this is the function
...ANSWER
Answered 2020-Feb-12 at 09:37Just send the buffer to the client and use this function to download the file (React sample code):
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install go-wkhtmltopdf
first looking in the current dir
looking in the PATH and PATHEXT environment dirs
using the WKHTMLTOPDF_PATH environment dir
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