Skip to content

Commit 35ff6b4

Browse files
authored
Add link service prop (#256)
1 parent 0fccfd3 commit 35ff6b4

File tree

2 files changed

+18
-11
lines changed

2 files changed

+18
-11
lines changed

README.md

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -58,17 +58,18 @@ const pdfSource = '<PDF_URL>'
5858

5959
### Props
6060

61-
| Name | Type | Accepted values | Description |
62-
| ------------------ | ---------------------- | ------------------------------------------------------- | -------------------------------------------------------------------------- |
63-
| annotationLayer | `boolean` | `true` or `false` | whether the annotation layer should be enabled |
64-
| height | `number` | natural numbers | desired page height in pixels (ignored if the width property is specified) |
65-
| imageResourcesPath | `string` | URL or path with trailing slash | path for icons used in the annotation layer |
66-
| page | `number` | `1` to the last page number | number of the page to display (displaying all pages if not specified) |
67-
| rotation | `number` | `0`, `90`, `180`, `270` (multiples of `90`) | desired page rotation angle in degrees |
68-
| scale | `number` | rational numbers | desired page viewport scale |
69-
| source | `string` <br> `object` | document URL or Base64 or typed array or document proxy | source of the document to display |
70-
| textLayer | `boolean` | `true` or `false` | whether the text layer should be enabled |
71-
| width | `number` | natural numbers | desired page width in pixels |
61+
| Name | Type | Accepted values | Description |
62+
| ------------------ | ---------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------------------------------------------ |
63+
| annotationLayer | `boolean` | | whether the annotation layer should be enabled |
64+
| height | `number` | natural numbers | desired page height in pixels (ignored if the width property is specified) |
65+
| imageResourcesPath | `string` | URL or path with trailing slash | path for icons used in the annotation layer |
66+
| linkService | `PDFLinkService` | | document navigation service to override the default one (emitting `internal-link-clicked`) |
67+
| page | `number` | `1` to the last page number | number of the page to display (displaying all pages if not specified) |
68+
| rotation | `number` | `0`, `90`, `180`, `270` (multiples of `90`) | desired page rotation angle in degrees |
69+
| scale | `number` | rational numbers | desired page viewport scale |
70+
| source | `string` <br> `object` <br> `PDFDocumentProxy` | document URL or Base64 or typed array or document proxy | source of the document to display |
71+
| textLayer | `boolean` | | whether the text layer should be enabled |
72+
| width | `number` | natural numbers | desired page width in pixels |
7273

7374
### Events
7475

src/VuePdfEmbed.vue

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ const props = withDefaults(
3838
* Path for annotation icons, including trailing slash.
3939
*/
4040
imageResourcesPath?: string
41+
/**
42+
* Document navigation service.
43+
*/
44+
linkService?: PDFLinkService
4145
/**
4246
* Number of the page to display.
4347
*/
@@ -103,6 +107,8 @@ const { doc } = useVuePdfEmbed({
103107
const linkService = computed(() => {
104108
if (!doc.value || !props.annotationLayer) {
105109
return null
110+
} else if (props.linkService) {
111+
return props.linkService
106112
}
107113
108114
const service = new PDFLinkService()

0 commit comments

Comments
 (0)