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

feat(pdf) : load/save CiceroMark and templates to PDF #351

Merged
merged 2 commits into from
Mar 2, 2021

Conversation

dselman
Copy link
Contributor

@dselman dselman commented Jan 27, 2021

Signed-off-by: Dan Selman [email protected]

Changes

  • Embeds CiceroMark into the PDF metadata
  • Embeds an array of templates into the PDF metadata (as base64 strings)
  • Loads CiceroMark from the PDF metadata and returns it
  • Loads templates from the PDF metadata and returns them (as base64 strings)

pdf-metadata
Viewing PDF metadata inside Acrobat

roundtrip.md.pdf
PDF with embedded CiceroMark and Acceptance of Delivery template

Flags

  • Should we add an optional attribute templates to org.accordproject.commonmark.Document?
  • What are the size limitations on metadata?
  • Should we change the implementation so that the user supplies a map object containing the templates (with template uri as the key, and the template archive as the value), and then we walk the CiceroMark including all the templates that are referenced?
    • the advantage of this approach would be that the recipient of the PDF could "rewire" those CiceroMark clauses after they've uploaded the templates to their private repository

Related Issues

@dselman
Copy link
Contributor Author

dselman commented Jan 27, 2021

@jeromesimeon for review and discussion. This gets us a step closer to being able to exchange CiceroMark + templates. It uses the PDF as the carrier in this case.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.04%) to 89.081% when pulling fc2fe7a on ds-pdf-metadata into 86f30a5 on master.

Copy link
Member

@jeromesimeon jeromesimeon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dselman
Copy link
Contributor Author

dselman commented Feb 17, 2021

TemplateMark + Data => CiceroMark : Use case 1, allows someone to see the values of the data, and regenerate the natural language

Execution would require Cicero Template : Use case 2, allows someone to simulate or process transactions

fn(templateMark) -> template*
templateUri : base64

@dselman dselman merged commit 8753351 into master Mar 2, 2021
@dselman dselman deleted the ds-pdf-metadata branch March 2, 2021 18:03
@jeromesimeon
Copy link
Member

@dselman Can we get a status report on this tomorrow? I'm unclear what proposal went in and if we need to open an issue about this (was there ever one?).

@jeromesimeon
Copy link
Member

TemplateMark + Data => CiceroMark : Use case 1, allows someone to see the values of the data, and regenerate the natural language

Execution would require Cicero Template : Use case 2, allows someone to simulate or process transactions

fn(templateMark) -> template*
templateUri : base64

Most specifically was this proposal implemented?

@dselman
Copy link
Contributor Author

dselman commented Mar 17, 2021

Sure. The merged code allows the caller to optionally pass an array of templates that are stored in the PDF (off by default).

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.

3 participants