html2pdf generates corrupted parts in the downloaded file - html

I used html2pdf in my code to enable converting html files to pdf ones then downloading them.
In my html file I have some statistic graphics coded using amChart.
The problem is that I have got a perfect file but with corrupted parts. The parts that contains the amChart graphics.Here is the graph in the html page:
and here is what I have got in the downloaded pdf file
I used this code to enable the download (with angular I just installed the necessary dependecies using bower).
Hello Someone
<div pdf-save-content="idOne" >
Hello Someone
</div>
Can someone please help me fix this problem?
I know that amchart provides a library to download the graphs with different forms (csv, png,pdf,..) it's not what need, I need to download the whole page.
it's not either a width problem.

to solve this problem I used this amCharts demo. It was better to use pdfMake than html2pdf
chart["export"].toPDF(layout, function(data) {
this.download(data, "application/pdf", "amCharts.pdf");
});

Related

Using pdfkit to convert embedded images

I am trying to convert HTML files into PDFs, using pdfkit on python. I use the very simple code below:
import pdfkit
pdfkit.from_file('in.html', 'out.pdf')
The problem is that these HTMLs have charts (like Highcharts or Plotly) embedded into them and they do not show on out.pdf. I know from this GitHub post which describes the same issue that this has been a long standing problem with wkhtmltopdf, which has still not been fully resolved. Yet I was wondering if there was a workaround?
Thank you!
Kind regards

Export/Download Clickfunnels as HTML (including all assets)

I'm trying to download a a funnel in Clickfunnels as a whole assets. I know the typical step that Clickfunnel have in exporting HTML is through the Publishing option->Export as HTML
. But it don't include the whole code and assets used in front-end. Anybody have an idea to download the funnel including the images,fonts,css, html used? Thanks
As far as I know you can not download/export everything as HTML.

Python jupyter notebook after converting to html , numbering of markdown disappeared

I used Table of Contents(2) of Nbextensions to create Table of Contents. And the titles were created using markdown.
Every thing is working fine. I mean , it looks pretty good in notebook modus.
But after I had converted the ipynb file to html file , then the number of each title dispeared . I used menu: File->Download as -> HTML to do this.
I tried to use another option "File->Download as ->HTML with toc" to convert to html. Although it generated desired numbering , this is still not what I want, because it will generate not only an html file but also multiple images file if there are some plots in the notebook.
Does anyone have a good idea?
I just need a SINGLE html file with everything embedded .
The numbering of the Nbextensions will be present if you'll download the notebook to PDF (after installing the relevant packages).
Regarding the HTML version, I didn't find an answer yet and will be happy for help either.
Notebook uses different formatting for the content. Exporting option only provide you to save your code. So, that you can send it to others.
Better save the data in the python notebook form itself to maintain formatting. Even exporting you to PDF won't provide you true formatting as the notebook does. But it will be better than HTML.
But if you still want the HTML format, you can format it manually as a webpage. May the formatting get improved in next version of nbconvert.

Accessing JSON file with d3.js and Vaadin

I've read several Threads here on d3.js and JSON, I could not fix my problem though.
Please see the picture attached. I'm working with Vaadin and integrated d3.js into my project. I now owuld like to display a forced graph with d3.js, using a local graph.json file.
All code works - except accessing the .json file.
The webapplication/website is displayed correctly, but the graph is empty/not there.
I assume the error lays somewhere here:
d3.json("graph.json", function(error, graph) {...}
please see picture here
I'd appreciate any help. (inb4 new to javascript)

how to export html form with canvas to pdf

I am trying to export an html page that contains html form and canvas to a pdf file (after onclick event (button)). I already been aware of wkhtmltopdf and PhantomJS but I think that it cannot be implemented as it should.
(the main problem is that I want to export the output offline, by covnerting the web app to android apk using the http://www.appsgeyser.com/)
To get your requirement, I hope you require to take pdf of web page.
if my understanding is correct, Please refer below link
http://www.hiqpdf.com/demo/ConvertHtmlToPdf.aspx
also see the existing post ITextSharp HTML to PDF?
Follow the Link of Zend_Pdf : http://framework.zend.com/manual/1.12/en/zend.pdf.html
You can also try jspdf : http://jspdf.com/
Or try to use javascript