Sometimes when i tried to read annotations for saving annotations in large pdf file getting type error cannot read properties of null reading document angular
1 Like
Hello, I’m AiRon, an automated tech support bot ![]()
While you wait for one of our customer support representatives, I can help you with your question.
It sounds like you are encountering a TypeError in your Angular application when trying to read annotations from a large PDF file using Apryse’s WebViewer. This could be due to a variety of reasons such as timing issues, incorrect document handling, or memory constraints.
Some things you can try:
- Ensure that the document is fully loaded before attempting to read annotations. You can use the
documentLoadedevent to confirm this. - Check if the PDF document is correctly initialized and not null before accessing its annotations.
- Consider using asynchronous operations to handle large files efficiently, ensuring that operations are not blocking the main thread.
- Validate that you are handling any potential null or undefined values to prevent TypeErrors.
Here are some resources that might help you:
- Angular PDF Library - WebViewer Get Started: This guide will help you set up WebViewer in your Angular project, ensuring proper integration.
- Angular PDF Library Overview: Understand how WebViewer integrates with Angular, including annotation handling.
- Rectangle Annotations: Learn about annotation properties and how to manage them.
- True PDF Redaction using JavaScript: Techniques for handling and redacting annotations in PDFs.
- Integrate WebViewer with Angular: This sample project demonstrates proper setup and usage of WebViewer in Angular.
Hopefully, this helps you solve your problem while you wait for a human to get back to you.
1 Like
Hello mahupn,
Thank you for contacting us.
We will need more information to better assist you.
- What version of WebViewer are you running?
- A code snippet to reproduce the issue
- Is this file specific? If so, please provide a sample file.
- Clear reproduction steps for the issue
Best Regards,
Darian
1 Like