Draw Chart while Exporting Pdf file - Django - django

I am using Jinja Template and WeasyPrint for PDF generation.
While calling a API, I have prepared the data in the back-end and export that data into PDF file.
I want include chart(Column Chart/Bar Chart) in the pdf file. I don't know how to include chart while exporting PDF. Because the data preparation and export everything should be happened in Back-end with single API.
Thanks in Advance.

Related

How can I view pdf files from an API with Vue Js?

Hello friends I need your support.. I am currently developing an app with django rest framework in the backend and vue js in the frontend.. the app consists of saving pdf files, which I can list in a table.. but the problem is that it only I can see by table the path where they are saved and I have not been able to view the files. Can someone tell me how I can place a button to view these files?
I have tried functions to download the files but I have not achieved a solution

Bokeh JS save plot as PNG programmatically

How to save plots in Bokeh JS as PNG programmatically?
The documentation gives the following example in Python:
from bokeh.io import export_png
export_png(plot, filename="plot.png")
I could however not find an example on how to programmatically save plots in JavaScript.
The use case is to generate plots in the back-end and use them in automatically generated reports.
Any tips on saving plots in Bokeh JS programmatically are welcome!

Django - how to render all pages of pdf files at once

I am trying to make a pdf viewer in HTML template using pdf.js in Django framework.
I had used a code that I got from a Youtube channel Traversy Media on how to create a custom PDF Viewer With JavaScript. It is working but I want to know if it's possible to render all pages at once.
Here's the link of the pdf.js full code in GitHub...
Is there an alternative way rather than sticking to this code?

save charts as image and include in pdf export

I have a donut chart (highcharts). By default, I can click on the export button to download the chart as image or other format. What I want to do is not download it. Save it somewhere and include it in the pdf export.
For example, say i have a donut chart which shows the expenses of a farm. I also have a tabular view of the same data. Right now what I can do is export the table as pdf/csv in django. I want to include the highchart as well in the pdf report. Is that possible? And how?
This feature is not build-in in our exporting, but you have two abilities:
setup your own exporting server and develop save file on your webserver
use highcharts cloud
Use a solution like this here which you can combine text, svg chart, tables, barcodes, whatever yku desire to PDF output
http://www.cloudformatter.com/CSS2Pdf
There are samples of all if this including highcharts shown on the pages.

Django + google app engine + spreadsheets api

I would like to know if Google Docs API or any other spreadsheet (xls) API or any reporting tool works with GAE, Django & application data from BigTable. In other words, I would like to generate spreadsheet with rich formatting - colors, fonts and upto 50 sheets in each file. And send this spreadsheet as E-Mail attachment to user or download using browser.
Thanks a lot,
Sandeep
I've used openpyxl to good effect with Django + AppEngine. Openpyxl can do styles and sheets and formatting and all that stuff, and saves to an .xlsx file. If you need .xls files, then perhaps have a look at something like xlwt.
If your spreadsheets are under 1MB, then they can be saved in/served with the Datastore just fine. Otherwise, you can use the Blobstore, but that would require using the AppEngine API instead of pure Django.