Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for exporting annotated pdfs #18

Closed
wants to merge 1 commit into from

Conversation

kayceesrk
Copy link

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
Copy link
Contributor

florian-wagner commented Apr 16, 2018

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:

  • A high-level exportPDF function, which calls a:
    • a transfer function: Handles all the ssh things, copies to a temp folder irrespective of the file being a notebook or a document
    • a lines2PDF function which calls rm2SVG and converts the foreground to PDF (with optional color support), after that either of the two scripts are called
      • a) templates2PDF: which checks the used templates and puts them to a background PDF
      • b) scaleBackground: which is called if a background PDF exists and which corrects for the page size of the original pdf

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
Copy link
Author

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.

@kayceesrk kayceesrk closed this Aug 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants