You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a django app I am trying to print a leaflet map in pdf using django-wkhtmltopdf, but the map is not rendering correctly. I even try to give more time to the 'javascript-delay' parameter but is giving me the same result. Here is the image of the map:
from wkhtmltopdf.views import PDFTemplateResponse
class MyPDFView(View):
template='agrimensuras/project_pdf.html' # the template
def get(self, request, pk):
project = get_object_or_404(Project, id = int(pk))
data = {"project": project}
response = PDFTemplateResponse(request=request,
template=self.template,
filename="hello.pdf",
context= data,
show_content_in_browser=False,
cmd_options={'margin-top': 10,
"zoom":1,
"viewport-size" :"1366 x 513",
'javascript-delay':1000,
'footer-center' :'[page]/[topage]',
"no-stop-slow-scripts":True},
)
return response
In the template (I am just showing the relevant pieces of code):
a tipp, check if you see any network/CORS issues in the developer tab, and try with a OSM backend which support CORS, like: https://server.arcgisonline.com/ArcGIS/
I have a django app I am trying to print a leaflet map in pdf using django-wkhtmltopdf, but the map is not rendering correctly. I even try to give more time to the 'javascript-delay' parameter but is giving me the same result. Here is the image of the map:
In the template (I am just showing the relevant pieces of code):
The text was updated successfully, but these errors were encountered: