I didn’t use any third-party service for annotations. The annotation functionality is implemented using custom JavaScript code, leveraging native Glide APIs and HTML5 Canvas. The data for annotations comes from Glide JavaScript columns, and everything operates directly within the app’s iframe.
The main issue lies in security, as exposing API keys on the frontend can be a concern if these annotations are to be saved back to Glide columns. Therefore, it’s better to develop this script using Google Apps Script (GAS) and deploy it as a Web App (which can be embedded with Glide’s web embed component). This approach is especially suitable for those using Glide integrated with Google Sheets, as it eliminates the need to involve Glide’s API.
If you are using Glide with Google Sheets, Google Apps Script can directly read and write data to Google Sheets without requiring Glide API. This method is particularly useful for Glide plans that already integrate directly with Google Sheets, as it avoids the need for additional API calls. For plans where integration with Google Sheets is not available, using the Glide API becomes unavoidable. Even in such cases, Google Apps Script remains the safest option because it allows you to securely store and manage the API key in the backend, preventing it from being exposed on the frontend.
Currently, this setup is tailored for image annotations, but it can be extended to support PDFs. However, to achieve this, you would need to render PDF pages as images using a library like PDF.js, overlay the annotation tools on the rendered canvas, and then save the annotations. Note that this approach will result in an exported PDF that includes the annotations as part of the image, not as separate layers within the PDF. If you wish to maintain the original PDF structure while adding annotations, you’ll need a more advanced library like pdf-lib or PDFKit to handle the direct manipulation of PDF files.
Since I’m no longer subscribed to Glide, I apologize for not being able to demonstrate how this application works in a PDF environment. However, if you only want to create Free Draw annotations, you can try doing so using Glide’s AI component. But if it involves text annotations, the complexity increases significantly, making it challenging to integrate and communicate with AI. Furthermore, as of now, I haven’t been successful in implementing download and print functions with the AI component.