From 46381a5257c6c0bf76865d9e7116bf7099e101d5 Mon Sep 17 00:00:00 2001 From: sinatayebati Date: Sun, 19 May 2024 17:06:49 -0500 Subject: [PATCH] #13 added readme and documentation --- README.md | 302 +++++++++++++++++++++++++++++++++++++++++++++++++- functions.txt | 105 ------------------ 2 files changed, 298 insertions(+), 109 deletions(-) delete mode 100644 functions.txt diff --git a/README.md b/README.md index e0acb37..6ec4c4e 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,301 @@ -# Vue 3 + Vite +## PDF Annotator -This template should help get you started developing with Vue 3 in Vite. The template uses Vue 3 ` + ``` + +The PDF.js viewer is seamlessly integrated into the Vue component using an `iframe`, making it easy to load and display PDF documents. + +## Annotating PDFs with pdfAnnotate + +The `annotPdf.vue` component leverages the [pdfAnnotate](https://github.com/highkite/pdfAnnotate) library to add various types of annotations to PDF documents. The intergation of this library for programmatic annotations at least on PDFjs is seamless. +* Note: I personally tested this library in production with dedicated backend working with huge amounts of data in json format, so it's reliable. The only bug I found was that setting the appearance flag to "hidden" ony works on highlight annotation, while it's supposed to work on other markup annotations as well. +* A huge thanks to [pdfAnnotate](https://github.com/highkite/pdfAnnotate) for creating such a great tool with reliable documentation (more documentation than the entire pdfjs project, Haha!) + +Here's how you can use it: + +### Available Annotations + +The `pdfAnnotate` library supports several types of annotations, including: +- Highlight +- Squiggly +- Underline +- Strikeout +- Square +- Oval +- and more + +### Parameters Required + +Each annotation type requires at least the following parameters: +- **page**: The page number where the annotation should be added. +- **rect**: The rectangle coordinates `[x1, y1, x2, y2]` defining the annotation's position. +- **contents**: The content of the annotation. +- **author**: The author of the annotation. +- **color**: The color of the annotation in `{ r, g, b }` format. +- **opacity**: The opacity of the annotation. + +for details and the rest of the documentation, I urge you to read their entire documentation at [pdfAnnotate](https://github.com/highkite/pdfAnnotate). + +* Note: one thing you need to be cautious is that pdfjs origin for a "rect" is top left, and pdfAnnotate origin is buttom left, so you need a simple conversion of "y" coordinates to create the list of your annotations. + + +### Script Setup + +```javascript + +``` + +### Styling + +```css + +``` + +By integrating `pdfAnnotate`, you can easily add programmatic annotations to your PDF documents. This library supports various annotation types, making it flexible and powerful for different use cases. + +--- + + + +Thank you for using the PDF Annotator project! We hope this guide helps you get the most out of your PDF viewing and annotation capabilities. Happy coding! \ No newline at end of file diff --git a/functions.txt b/functions.txt deleted file mode 100644 index b6034d2..0000000 --- a/functions.txt +++ /dev/null @@ -1,105 +0,0 @@ - - - - -