You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@echarts.apache.org by Abed Karakira <ak...@gmail.com> on 2021/08/11 08:27:49 UTC

Export To PDF

Hello,

I need to export apache echarts to a PDF. Is that possible?

Note: I have multiple charts to put in one PDF.

Best regards,
Abed Karakira

Re: Export To PDF

Posted by Zhongxiang Wang <wa...@apache.org>.
Hi Abed,

You can do this through *jsPDF* (mentioned in the last mail) [1] and
*html2canvas
*plugin [2].

Please take a try with the example:
https://codepen.io/plainheart/pen/BaRMGQO

Regards.

[1] https://rawgit.com/MrRio/jsPDF/master/docs/module-html.html#~html
[2] https://html2canvas.hertzen.com


On Mon, Aug 16, 2021 at 7:36 PM Abed Karakira <ak...@gmail.com> wrote:

> Hi again,
>
> I have the following I want to export to pdf.
>
> So I need to save the echarts as images (ex: png) to to print the same
> display to pdf.
> Please help.
>
> [image: Untitled.png]
>
> Best regards,
> Abed Karakira
>
>
> On Thu, Aug 12, 2021 at 5:55 AM Zhongxiang Wang <wa...@apache.org> wrote:
>
>> Hi Abed,
>>
>> It's suggested to export the image data through ECharts instance API
>> `getDataURL` [1] and use a third-party library, for example, jsPDF [2] to
>> write the images to a PDF file.
>>
>> Here is a simple example for your reference:
>> https://codepen.io/plainheart/pen/BaRMGQO.
>>
>> Regards.
>>
>> [1] https://echarts.apache.org/en/api.html#echartsInstance.getDataURL
>> [2] https://github.com/MrRio/jsPDF
>>
>>
>> On Wed, Aug 11, 2021 at 10:22 PM Abed Karakira <ak...@gmail.com>
>> wrote:
>>
>>> Hello,
>>>
>>> I need to export apache echarts to a PDF. Is that possible?
>>>
>>> Note: I have multiple charts to put in one PDF.
>>>
>>> Best regards,
>>> Abed Karakira
>>>
>>

Re: Export To PDF

Posted by Abed Karakira <ak...@gmail.com>.
Hi again,

I have the following I want to export to pdf.

So I need to save the echarts as images (ex: png) to to print the same
display to pdf.
Please help.

[image: Untitled.png]

Best regards,
Abed Karakira


On Thu, Aug 12, 2021 at 5:55 AM Zhongxiang Wang <wa...@apache.org> wrote:

> Hi Abed,
>
> It's suggested to export the image data through ECharts instance API
> `getDataURL` [1] and use a third-party library, for example, jsPDF [2] to
> write the images to a PDF file.
>
> Here is a simple example for your reference:
> https://codepen.io/plainheart/pen/BaRMGQO.
>
> Regards.
>
> [1] https://echarts.apache.org/en/api.html#echartsInstance.getDataURL
> [2] https://github.com/MrRio/jsPDF
>
>
> On Wed, Aug 11, 2021 at 10:22 PM Abed Karakira <ak...@gmail.com>
> wrote:
>
>> Hello,
>>
>> I need to export apache echarts to a PDF. Is that possible?
>>
>> Note: I have multiple charts to put in one PDF.
>>
>> Best regards,
>> Abed Karakira
>>
>

Re: Export To PDF

Posted by Zhongxiang Wang <wa...@apache.org>.
Hi Abed,

It's suggested to export the image data through ECharts instance API
`getDataURL` [1] and use a third-party library, for example, jsPDF [2] to
write the images to a PDF file.

Here is a simple example for your reference:
https://codepen.io/plainheart/pen/BaRMGQO.

Regards.

[1] https://echarts.apache.org/en/api.html#echartsInstance.getDataURL
[2] https://github.com/MrRio/jsPDF


On Wed, Aug 11, 2021 at 10:22 PM Abed Karakira <ak...@gmail.com> wrote:

> Hello,
>
> I need to export apache echarts to a PDF. Is that possible?
>
> Note: I have multiple charts to put in one PDF.
>
> Best regards,
> Abed Karakira
>