Announcing Dynamsoft Document Viewer 2.0: Enhanced PDF Viewing and Annotation Capabilities
Dynamsoft Document Viewer 2.0 is an online document viewing SDK designed specifically for web applications. With this release, developers can seamlessly integrate advanced PDF viewing, rendering, and annotation features into their web platforms. This version enhances the viewing experience by introducing robust annotation management, and adding advanced PDF export options for greater flexibility in handling online documents.
-
Supported Annotation Types
This version introduces a wide array of annotation types including Rectangle, Ellipse, Polygon, Polyline, Line, Ink, TextBox, Watermark, Stamp and Image insertion.
-
Document Security
This version also introduces vital enhancements to document security and branding with password-protected PDF saving and watermarking capabilities.
Read more about what’s new in Dynamsoft Document Viewer 2.0.
Try it for Yourself
Try out the new annotation features in the online demo:
Frequently Asked Questions
1. How to show the annotation set in the UI to enable this feature?
The annotation set
is a feature of the EditViewer
in Dynamsoft Document Viewer 2.0—to be specific. To display the annotation set in the UI, you need to enable this feature programmatically when creating the EditViewer
. Below is an example:
const editViewer = new Dynamsoft.DDV.EditViewer({
container: "container",
uiConfig: Dynamsoft.DDV.getDefaultUiConfig("editViewer", {
includeAnnotationSet: true
}),
});
Once enabled, users can interact with the annotation set through the UI, allowing them to add, edit, and manage annotations easily. Additionally, you can implement custom logic to control annotation behavior or adjust its appearance within the viewer.
2. How to add a watermark to an image or PDF file
You can add a text or image watermark to your file. For example, to add a text watermark, you have two options:
- Use built-in annotation toolbar: To add a text watermark with your brand name, use the TextBox tool from the built-in annotation toolbar. You can customize the text’s font color, opacity, size, and border color to fit your needs.
- Programmatic TextBox: Alternatively, you can create a TextBox programmatically using flexible APIs. This allows you to design a pre-set TextBox that aligns with your brand theme and specify its placement and pages.
If you save the document as an image, the watermark will become a permanent part of the image. When saving the document as a PDF, you can choose to use the ‘Flatten’ mode if you want the watermark to be non-editable and remain embedded in the document.
3. How to Redact a PDF
Dynamsoft Document Viewer 2.0 does not currently support redaction, which permanently removes sensitive content from a PDF. Redaction goes beyond simply covering up the content; it fully deletes it from the file to ensure it cannot be accessed, even in the underlying data.
As a workaround, you can use a solid Rectangle
to cover the content and then save the document in Image
or Flatten
mode to make the cover-up permanent. That being said, while the Flatten
mode hides the content from standard viewing and editing, it is not a replacement for true redaction methods that securely remove the content. If someone uses advanced tools or methods, there is a slim chance that remnants of the original content could be detected. The Image
mode permanently alters the image, ensuring complete security.
4. What are the options for saving a PDF?
Dynamsoft Document Viewer offers options to customize how PDFs are saved. Below are some key settings you can adjust:
- Compression type
- Page size
- Metadata like the author and title
- Password protection
- Annotation saving options:
- None: Do not save annotations.
- Image: Convert the file, including annotations, into an image-based format.
- Annotation: Save annotations as metadata.
- Flatten: Merge annotations into the document, making them non-editable and permanent.
5. How to password protect your PDF on saving
Dynamsoft Document Viewer 2.0 introduces a new password
attribute for the SavePdfSettings
interface. This attribute allows you to set a password for your PDF when saving it.
Here’s an example of how to use the SavePdfSettings
interface:
const pdfSettings = {
// author: "Dynamsoft",
// compression: "pdf/jpeg",
// pageType: "page/a4",
// creator: "DDV",
// creationDate: "D:20230101085959-08'00'",
// keyWords: "samplepdf",
// modifiedDate: "D:20230101090101-08'00'",
// producer: "Dynamsoft Document Viewer",
// subject: "SamplePdf",
// title: "SamplePdf",
// version: "1.5",
// quality: 90,
password: "dynamsoft",
saveAnnotation: "image",
// imageScaleFactor: 1,
};
6. How are text-based PDF rendered and saved in Dynamsoft Document Viewer
Render text-based PDFs
Dynamsoft Document Viewer uses a built-in PDF rasterizer to load and render text-based PDFs. While the text is not selectable or searchable within the viewer, the text layer is retained. This ensures that if you annotate and save the PDF, the text will remain searchable in other PDF viewers and editors.
Export text-based PDFs with annotations
When saving a text-based PDF, users can choose to either retain the text layer or rasterize the text (convert it into an image). If the PDF includes annotations, users have the option to save the annotations into the original text-based file or convert the entire document to an image-based format.
7. How to overwrite the default behavior of built-in elements?
Dynamsoft Document Viewer doesn’t support directly modifying the behavior of built-in elements. However, a workaround is available: you can create a custom element to replace one of the built-in elements. This allows you to define the behavior of the custom element according to your specific requirements.
8. What happens if Dynamsoft Document Viewer loads a PDF file with unsupported annotations?
If a PDF file contains unsupported annotation types, such as attachments or media, Dynamsoft Document Viewer will still load the file without issue. However, these unsupported annotations will either not be displayed or will be visible but not editable in the UI.
In such cases, the SDK will classify the annotation type as either Incomplete or Unknown.
Ready to Get Started?
Try online demo of Dynamsoft Document Viewer 2.0 and experience the new features for yourself. Whether you’re working with PDFs, annotations, or images, our viewer is built to streamline your document management process.