Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
TaTo30 committed May 26, 2024
1 parent 87caf4b commit bdfae89
Show file tree
Hide file tree
Showing 9 changed files with 85 additions and 52 deletions.
16 changes: 12 additions & 4 deletions docs/.vitepress/config.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
import { version } from '../package.json'

export default {
vite: {
optimizeDeps: {
include: ['pdfjs-dist'],
esbuildOptions: {
supported: {
'top-level-await': true,
},
},
},
},
title: 'VuePDF',
description: 'PDF component for Vue 3',
base: '/vue-pdf/',
lastUpdated: true,
head: [
['link', { rel: 'icon', type: 'image/png', href: '/logo.png' }],
],
head: [['link', { rel: 'icon', type: 'image/png', href: '/logo.png' }]],
themeConfig: {
logo: '/logo.png',
editLink: {
Expand Down Expand Up @@ -159,7 +167,7 @@ export default {
link: 'multiple_pdf',
},
{
text: 'TOC',
text: 'Table of Content',
link: 'toc',
},
],
Expand Down
2 changes: 1 addition & 1 deletion docs/.vitepress/styles/index.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
:root{
--vp-home-hero-image-filter: blur(100px);
--vp-home-hero-image-background-image: url("data:image/svg+xml;utf8,%3Csvg viewBox=%220 0 1000 1000%22 xmlns=%22http:%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cdefs%3E%3CclipPath id=%22a%22%3E%3Cpath fill=%22currentColor%22 d=%22M952.5 647Q905 794 780 885t-280 91q-155 0-280-91T47.5 647Q0 500 47.5 353T220 115q125-91 280-91t280 91q125 91 172.5 238t0 294Z%22%2F%3E%3C%2FclipPath%3E%3C%2Fdefs%3E%3Cg clip-path=%22url(%23a)%22%3E%3Cpath fill=%22%2399ecc7%22 d=%22M952.5 647Q905 794 780 885t-280 91q-155 0-280-91T47.5 647Q0 500 47.5 353T220 115q125-91 280-91t280 91q125 91 172.5 238t0 294Z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E");
--vp-home-hero-image-background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="1080" height="1080" viewBox="0 0 1080 1080" xml:space="preserve"><g transform="matrix(16.38 0 0 12.52 540.17 412.6)" id="13ef2270-b5eb-4f46-b1a2-b1016b0874b1" ><rect style="stroke: rgb(0,0,0); stroke-width: 0; stroke-dasharray: none; stroke-linecap: butt; stroke-dashoffset: 0; stroke-linejoin: miter; stroke-miterlimit: 4; fill: rgb(153,236,199); fill-rule: nonzero; opacity: 1;" vector-effect="non-scaling-stroke" x="-33.0835" y="-33.0835" rx="0" ry="0" width="66.167" height="66.167" /></g><g transform="matrix(16.56 0 0 12.26 540 1225.25)" id="397aaf24-ed57-4d7e-afca-cff19718b480" ><rect style="stroke: rgb(0,0,0); stroke-width: 0; stroke-dasharray: none; stroke-linecap: butt; stroke-dashoffset: 0; stroke-linejoin: miter; stroke-miterlimit: 4; fill: rgb(255,236,255); fill-rule: nonzero; opacity: 1;" vector-effect="non-scaling-stroke" x="-33.0835" y="-33.0835" rx="0" ry="0" width="66.167" height="66.167" /></g></svg>');
}

.button-example {
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/advanced/toc.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ watchEffect(() => {
outlineTree.value = info.value.outline.map(function convert(node) {
return {
title: node.title,
destination: getPDFDestination(info.value.document, node.dest),
destination: getPDFDestination(node.dest),
items: node.items.map((item) => {
return convert(item)
}),
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/loaded_events/annotation_loaded.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Loaded Event
# Annotation Loaded Event

::: warning
Annotation loaded event's payload has too many data to display on screen, open the console to see the results.
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/loaded_events/text_loaded.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Loaded Event
# Text Loaded Event

::: warning
Text loaded event's payload has too many data to display on screen, open the console to see the results.
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/loaded_events/xfa_loaded.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Loaded Event
# XFA Loaded Event

```vue
<script setup>
Expand Down
34 changes: 34 additions & 0 deletions docs/guide/composables.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,16 @@ Type: `PDFDocumentLoadingTask`

Document's loading task, see [PDFDocumentLoadingTask](https://mozilla.github.io/pdf.js/api/draft/module-pdfjsLib-PDFDocumentLoadingTask.html) for more details.

---

#### pages

Type: `int`

Document's number pages.

---

#### info

Type: `object`
Expand All @@ -114,6 +118,36 @@ Document's information object.
"outline": {...} // Outline objects
}
```
---

#### getPDFDestination

Type: `function`

This function returns the page number referenced by `dest` object used by internal-links or outline object. Check the related example in [Table of Content](../examples/advanced/toc.md)

---

#### print

Type: `function`

Open the browser's print dialog with current PDF loaded with the following parameters:

- `dpi`: Pages resolution (default: `150`).
- `filename`: Filename of the printed file (default: `'filename'`).

---

#### download

Type: `function`

Trigger a downloading action using an `HTMLAnchorElement` with the following parameters:

- `filename`: Filename of the downloaded file (default: `'filename'`)

---

### Document API

Expand Down
73 changes: 32 additions & 41 deletions docs/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions docs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vue-pdf-docs",
"version": "1.9.7",
"version": "1.10.0",
"description": "VuePDF Documentation",
"main": "index.js",
"repository": "https://github.com/TaTo30/VuePDF",
Expand All @@ -15,6 +15,6 @@
"vitepress": "^1.2.2"
},
"dependencies": {
"@tato30/vue-pdf": "^1.9.7"
"@tato30/vue-pdf": "^1.10.0"
}
}

0 comments on commit bdfae89

Please sign in to comment.