Skip to content

Commit

Permalink
Merge pull request #142 from CareEvolution/mmertsock/consent-html
Browse files Browse the repository at this point in the history
Add htmlWithSignatures
  • Loading branch information
mmertsock authored Aug 5, 2023
2 parents dc5a224 + 98bc2ba commit 0539887
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ORK1Kit/ORK1Kit/Consent/ORK1ConsentDocument.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,11 @@ ORK1_CLASS_AVAILABLE
*/
- (void)addSignature:(ORK1ConsentSignature *)signature;

/**
Produces an HTML version of the consent document with signature images embedded.
*/
@property (nonatomic, readonly) NSString *htmlWithSignatures;

/// @name Alternative content provision

/**
Expand Down
4 changes: 4 additions & 0 deletions ORK1Kit/ORK1Kit/Consent/ORK1ConsentDocument.m
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ - (void)addSignature:(ORK1ConsentSignature *)signature {
[_signatures addObject:signature];
}

- (NSString *)htmlWithSignatures {
return [self htmlForMobile:NO withTitle:nil detail:nil];
}

- (void)makePDFWithCompletionHandler:(void (^)(NSData *data, NSError *error))completionBlock {
[_writer writePDFFromHTML:[self htmlForMobile:NO withTitle:nil detail:nil]
withCompletionBlock:^(NSData *data, NSError *error) {
Expand Down
5 changes: 5 additions & 0 deletions ResearchKit/Consent/ORKConsentDocument.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,11 @@ ORK_CLASS_AVAILABLE
*/
- (void)addSignature:(ORKConsentSignature *)signature;

/**
Produces an HTML version of the consent document with signature images embedded.
*/
@property (nonatomic, readonly) NSString *htmlWithSignatures;

/// @name Alternative content provision

/**
Expand Down
4 changes: 4 additions & 0 deletions ResearchKit/Consent/ORKConsentDocument.m
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ - (void)addSignature:(ORKConsentSignature *)signature {
[_signatures addObject:signature];
}

- (NSString *)htmlWithSignatures {
return [self htmlForMobile:NO title:nil detail:nil];
}

- (void)makePDFWithCompletionHandler:(void (^)(NSData *data, NSError *error))completionBlock {
[_writer writePDFFromHTML:[self htmlForMobile:NO title:nil detail:nil]
completionBlock:^(NSData *data, NSError *error) {
Expand Down

0 comments on commit 0539887

Please sign in to comment.