Question: I have a table with two columns, id and modifiedDate. I want to query this table to list each id's activity between a time range.
My table looks like:

```
+-----+------------+
| ID  |     Date   |
+-----+------------+
| 1   | 2017.01.19 |
| 1   | 2017.01.18 |
| 1   | 2017.01.10 |
| 1   | 2017.01.09 |
| 2   | 2017.01.19 |
| 2   | 2017.01.18 |
| 2   | 2017.01.10 |
| 2   | 2017.01.09 |
+-----+------------+

Desired output: 

+-----+-----------------+------------+-------+
| ID  |     this week   | last week  | total |
+-----+-----------------+------------+-------+
| 1   |        2        |      2     |   4   | 
| 2   |        2        |      2     |   4   |
+-----+-----------------+------------+-------+

```

Answer: 
For your 2nd question: 

You can use base64 encoded images. It works with jspdf.
To convert image into base64, check this: [How to convert image into base64 string using javascript](https://stackoverflow.com/questions/6150289/how-to-convert-image-into-base64-string-using-javascript)
1 You need to check the pdf size and adjust it.

2 The base64 image renders in the jspdf. You can use this link for getting base64 code and paste it in img src value <https://www.base64-image.de/>