hande hyplerlink references in header or footers

This commit is contained in:
amitm02
2018-10-02 16:17:26 +03:00
parent a1e20f4c9a
commit ffdcc7baca
3 changed files with 31 additions and 7 deletions

View File

@ -55,6 +55,15 @@ export class FooterWrapper {
return mediaData;
}
public addHyperlinkRelationship(target: string, refId: number, targetMode?: "External" | undefined): void {
this.relationships.createRelationship(
refId,
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink",
target,
targetMode,
);
}
public createImage(image: Buffer, width?: number, height?: number): void {
const mediaData = this.addImageRelationship(image, this.relationships.RelationshipCount, width, height);
this.addImage(new Image(new ImageParagraph(mediaData)));