reHackable / maxio

Companion daemon for the reMarkableā„¢ paper tablet
GNU Lesser General Public License v3.0
155 stars 52 forks source link

Add support for exporting annotated pdfs #18

Closed kayceesrk closed 5 years ago

kayceesrk commented 6 years ago

Exporting annotated pdfs through the native apps is broken since the native export functionality does not account for the different page sizes between the tablet and the pdf. The PR introduces a script exportDocument to export the PDF and correct for the page sizes. Moreover, the exported pdf is not a bitmap unlike the native export functionality and retains the vector graphics. Hence, the exported pdf remains selectable and searchable.


Exporting natively using the Mac app: screen shot 2018-04-15 at 14 22 41 screen shot 2018-04-15 at 14 39 59

Export using exportDocument: screen shot 2018-04-15 at 14 34 06 screen shot 2018-04-15 at 14 40 13

florian-wagner commented 6 years ago

Hi @kayceesrk,

thanks for your contribution! I like the granular scale height and width functions. However, this PR introduces some redundancy as it neglects the fact that exportNotebook also exports documents (and corrects page sizes if they are A4, see also PRs #7 and #12). It also has optional color support as shown here: https://github.com/reHackable/maxio/files/1695105/remarkable-c.pdf

I am not quite sure how we proceed and I am curious what @edupont and @Ameb think. I am pro granularity and against redundancy. Ideally one would have:

and finally the exportPDF function would call pdftk multistamp to put foreground and background together and delete the temp folder.

What do you guys think?

kayceesrk commented 6 years ago

Thanks @florian-wagner. I hadn't realised exportNotebook also corrected for sizes. It might be best to break up the functionality into smaller scripts as you have proposed to avoid redundancy.