# Project: Remove and replace html2pdf with a more up to date tool

**URL:** <https://forums.librehealth.io/t/project-remove-and-replace-html2pdf-with-a-more-up-to-date-tool/1844>\
**Category:** Google Summer of Code\
**Tags:** gsoc2018, ehr, gsoc2018-project\
**Created:** [January 5, 2018, 6:43pm UTC](https://forums.librehealth.io/t/project-remove-and-replace-html2pdf-with-a-more-up-to-date-tool/1844 "2018-01-05T18:43:59Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![aethelwulffe](https://forums.librehealth.io/user_avatar/forums.librehealth.io/aethelwulffe/32/63_2.png) [@aethelwulffe](https://forums.librehealth.io/u/aethelwulffe)\
**Post date:** [January 20, 2018, 5:41pm UTC](https://forums.librehealth.io/t/project-remove-and-replace-html2pdf-with-a-more-up-to-date-tool/1844/21 "2018-01-20T17:41:27Z")

</div>

By all means, review the PR for that!

---

<div class="post-metadata">

**Author:** ![Abhinav](https://forums.librehealth.io/user_avatar/forums.librehealth.io/abhinav/32/626_2.png) [@Abhinav](https://forums.librehealth.io/u/Abhinav)\
**Post date:** [February 17, 2018, 10:14am UTC](https://forums.librehealth.io/t/project-remove-and-replace-html2pdf-with-a-more-up-to-date-tool/1844/22 "2018-02-17T10:14:16Z")

</div>

@teryhill are we having this project for GSOC?

---

<div class="post-metadata">

**Author:** ![teryhill](https://forums.librehealth.io/user_avatar/forums.librehealth.io/teryhill/32/58_2.png) [@teryhill](https://forums.librehealth.io/u/teryhill)\
**Post date:** [February 17, 2018, 11:47am UTC](https://forums.librehealth.io/t/project-remove-and-replace-html2pdf-with-a-more-up-to-date-tool/1844/23 "2018-02-17T11:47:28Z")

</div>

It is a project that could be done during GSoC. We will review all the proposals and make selections from them.

---

<div class="post-metadata">

**Author:** ![Abhinav](https://forums.librehealth.io/user_avatar/forums.librehealth.io/abhinav/32/626_2.png) [@Abhinav](https://forums.librehealth.io/u/Abhinav)\
**Post date:** [February 17, 2018, 11:49am UTC](https://forums.librehealth.io/t/project-remove-and-replace-html2pdf-with-a-more-up-to-date-tool/1844/24 "2018-02-17T11:49:29Z")

</div>

@teryhill we are using html2pdf here which uses TCPDF. I think we can directly use TCPDF?

---

<div class="post-metadata">

**Author:** ![teryhill](https://forums.librehealth.io/user_avatar/forums.librehealth.io/teryhill/32/58_2.png) [@teryhill](https://forums.librehealth.io/u/teryhill)\
**Post date:** [February 17, 2018, 1:30pm UTC](https://forums.librehealth.io/t/project-remove-and-replace-html2pdf-with-a-more-up-to-date-tool/1844/25 "2018-02-17T13:30:21Z")

</div>

There are a number of options out there. The tool used needs to be a current version.

---

<div class="post-metadata">

**Author:** ![Abhinav](https://forums.librehealth.io/user_avatar/forums.librehealth.io/abhinav/32/626_2.png) [@Abhinav](https://forums.librehealth.io/u/Abhinav)\
**Post date:** [February 17, 2018, 1:59pm UTC](https://forums.librehealth.io/t/project-remove-and-replace-html2pdf-with-a-more-up-to-date-tool/1844/26 "2018-02-17T13:59:57Z")

</div>

I will search for more.

---

<div class="post-metadata">

**Author:** ![Abhinav](https://forums.librehealth.io/user_avatar/forums.librehealth.io/abhinav/32/626_2.png) [@Abhinav](https://forums.librehealth.io/u/Abhinav)\
**Post date:** [February 18, 2018, 2:34am UTC](https://forums.librehealth.io/t/project-remove-and-replace-html2pdf-with-a-more-up-to-date-tool/1844/27 "2018-02-18T02:34:01Z")

</div>

@teryhill I searched on the net and the best library I found was TCPDF. It is the most easy to use PHP library to create PDF’s and it doesn’t require executable files as everything works with Plain PHP

> **[Top 5 : Best open source PDF generation libraries for PHP](https://ourcodeworld.com/articles/read/226/top-5-best-open-source-pdf-generation-libraries-for-php)**
>
> See our collection from 5 of the best PDF generator libraries for PHP.

---

<div class="post-metadata">

**Author:** ![teryhill](https://forums.librehealth.io/user_avatar/forums.librehealth.io/teryhill/32/58_2.png) [@teryhill](https://forums.librehealth.io/u/teryhill)\
**Post date:** [February 18, 2018, 2:53am UTC](https://forums.librehealth.io/t/project-remove-and-replace-html2pdf-with-a-more-up-to-date-tool/1844/28 "2018-02-18T02:53:40Z")

</div>

Is there a version of it in the current code base?

---

<div class="post-metadata">

**Author:** ![Abhinav](https://forums.librehealth.io/user_avatar/forums.librehealth.io/abhinav/32/626_2.png) [@Abhinav](https://forums.librehealth.io/u/Abhinav)\
**Post date:** [February 18, 2018, 2:55am UTC](https://forums.librehealth.io/t/project-remove-and-replace-html2pdf-with-a-more-up-to-date-tool/1844/29 "2018-02-18T02:55:28Z")

</div>

I think its not in the current code base.

---

<div class="post-metadata">

**Author:** ![Abhinav](https://forums.librehealth.io/user_avatar/forums.librehealth.io/abhinav/32/626_2.png) [@Abhinav](https://forums.librehealth.io/u/Abhinav)\
**Post date:** [February 18, 2018, 2:57am UTC](https://forums.librehealth.io/t/project-remove-and-replace-html2pdf-with-a-more-up-to-date-tool/1844/30 "2018-02-18T02:57:15Z")

</div>

We are having FPDF perhaps.

---

<div class="post-metadata">

**Author:** ![teryhill](https://forums.librehealth.io/user_avatar/forums.librehealth.io/teryhill/32/58_2.png) [@teryhill](https://forums.librehealth.io/u/teryhill)\
**Post date:** [February 18, 2018, 3:00am UTC](https://forums.librehealth.io/t/project-remove-and-replace-html2pdf-with-a-more-up-to-date-tool/1844/31 "2018-02-18T03:00:33Z")

</div>

Goto GSoC Chat channel

---

<div class="post-metadata">

**Author:** ![Abhinav](https://forums.librehealth.io/user_avatar/forums.librehealth.io/abhinav/32/626_2.png) [@Abhinav](https://forums.librehealth.io/u/Abhinav)\
**Post date:** [February 23, 2018, 12:02pm UTC](https://forums.librehealth.io/t/project-remove-and-replace-html2pdf-with-a-more-up-to-date-tool/1844/32 "2018-02-23T12:02:56Z")

</div>

@teryhill I am interested in this project.

---

<div class="post-metadata">

**Author:** ![Abhinav](https://forums.librehealth.io/user_avatar/forums.librehealth.io/abhinav/32/626_2.png) [@Abhinav](https://forums.librehealth.io/u/Abhinav)\
**Post date:** [March 1, 2018, 9:45am UTC](https://forums.librehealth.io/t/project-remove-and-replace-html2pdf-with-a-more-up-to-date-tool/1844/33 "2018-03-01T09:45:19Z")

</div>

@teryhill we have put the pdf generation code in **interface/patient\_file/report/custom\_report.php**. I propose that we create a separate file for pdf generation and which will be called when pdf generation is needed in this way we will increase the speed of the code by not unnecessarily using the pdf generation code in **custom\_report.php**.

---

<div class="post-metadata">

**Author:** ![aethelwulffe](https://forums.librehealth.io/user_avatar/forums.librehealth.io/aethelwulffe/32/63_2.png) [@aethelwulffe](https://forums.librehealth.io/u/aethelwulffe)\
**Post date:** [March 1, 2018, 3:57pm UTC](https://forums.librehealth.io/t/project-remove-and-replace-html2pdf-with-a-more-up-to-date-tool/1844/34 "2018-03-01T15:57:17Z")

</div>

html2pdf is by itself, and under /modules. We should only be calling it (or similar) by including the class file. Header include function files are pretty small, but should have very narrow scope. custom\_report.php does not exactly meet that standard.

---

<div class="post-metadata">

**Author:** ![Abhinav](https://forums.librehealth.io/user_avatar/forums.librehealth.io/abhinav/32/626_2.png) [@Abhinav](https://forums.librehealth.io/u/Abhinav)\
**Post date:** [March 1, 2018, 5:27pm UTC](https://forums.librehealth.io/t/project-remove-and-replace-html2pdf-with-a-more-up-to-date-tool/1844/35 "2018-03-01T17:27:19Z")

</div>

@aethelwulffe I made a separate file, passed the data to the file for pdf generation. The readability of the code is improved. Today I created the pdf for **Transactions** part of the report. Tomorrow I will show the prototype code.

---

<div class="post-metadata">

**Author:** ![Abhinav](https://forums.librehealth.io/user_avatar/forums.librehealth.io/abhinav/32/626_2.png) [@Abhinav](https://forums.librehealth.io/u/Abhinav)\
**Post date:** [April 2, 2018, 11:38am UTC](https://forums.librehealth.io/t/project-remove-and-replace-html2pdf-with-a-more-up-to-date-tool/1844/36 "2018-04-02T11:38:17Z")

</div>

@teryhill I was thinking of making a separate folder named **pdf\_generator** (or something like that). All the files required for making PDFs will be kept there.

---

<div class="post-metadata">

**Author:** ![teryhill](https://forums.librehealth.io/user_avatar/forums.librehealth.io/teryhill/32/58_2.png) [@teryhill](https://forums.librehealth.io/u/teryhill)\
**Post date:** [April 2, 2018, 12:06pm UTC](https://forums.librehealth.io/t/project-remove-and-replace-html2pdf-with-a-more-up-to-date-tool/1844/37 "2018-04-02T12:06:05Z")

</div>

That is a good Idea, maybe putting it in the Modules directory

---

<div class="post-metadata">

**Author:** ![Abhinav](https://forums.librehealth.io/user_avatar/forums.librehealth.io/abhinav/32/626_2.png) [@Abhinav](https://forums.librehealth.io/u/Abhinav)\
**Post date:** [April 2, 2018, 12:06pm UTC](https://forums.librehealth.io/t/project-remove-and-replace-html2pdf-with-a-more-up-to-date-tool/1844/38 "2018-04-02T12:06:46Z")

</div>

Yes, this type of approach will make our codebase more clean

---

<div class="post-metadata">

**Author:** ![Abhinav](https://forums.librehealth.io/user_avatar/forums.librehealth.io/abhinav/32/626_2.png) [@Abhinav](https://forums.librehealth.io/u/Abhinav)\
**Post date:** [April 2, 2018, 12:08pm UTC](https://forums.librehealth.io/t/project-remove-and-replace-html2pdf-with-a-more-up-to-date-tool/1844/39 "2018-04-02T12:08:27Z")

</div>

I am thinking about more improvements, excited for 23rd 😁

---

<div class="post-metadata">

**Author:** ![teryhill](https://forums.librehealth.io/user_avatar/forums.librehealth.io/teryhill/32/58_2.png) [@teryhill](https://forums.librehealth.io/u/teryhill)\
**Post date:** [April 2, 2018, 12:10pm UTC](https://forums.librehealth.io/t/project-remove-and-replace-html2pdf-with-a-more-up-to-date-tool/1844/40 "2018-04-02T12:10:33Z")

</div>

I am sweating for y’all. 😟

[Previous page](https://forums.librehealth.io/t/project-remove-and-replace-html2pdf-with-a-more-up-to-date-tool/1844.md?page=1)

[Next page](https://forums.librehealth.io/t/project-remove-and-replace-html2pdf-with-a-more-up-to-date-tool/1844.md?page=3)
