Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ This accessible PDF reading feature supports two approaches:
2. Windows Speech Synthesis API

The following demo illustrates both supported approaches:
- [Blazor PDF Viewer example -Accessible PDF Reading]()
- [Blazor PDF Viewer example -Accessible PDF Reading](https://document.syncfusion.com/demos/pdf-viewer/blazor-server/pdf-viewer/accessible-pdf-reading?theme=fluent2)

## Microsoft Edge’s Screen Reader

Expand Down Expand Up @@ -61,7 +61,6 @@ function initPdfAccessibility() {
});
mutationObserver.observe(viewerInfo.container, { childList: true, subtree: true });
}

// Get viewer container and ID
function getViewerInfo() {
const container = document.querySelector('.e-pv-viewer-container');
Expand Down Expand Up @@ -120,15 +119,13 @@ function wirePage(div) {
div.addEventListener('click', () => focusPageDiv(div));
div.setAttribute('data-a11y-init', 'true');
}

// Reader the selected text aloud - Mircosoft Reader
function readAloudText(text) {
window.speechSynthesis.cancel();
const utterance = new SpeechSynthesisUtterance(text);
window.speechSynthesis.speak(utterance);
}

// Cancel speech and remove highlights - Mircosoft Reader
// Cancel speech - Mircosoft Reader
function cancelReading() {
if (window.speechSynthesis?.speaking) {
window.speechSynthesis.cancel();
Expand Down Expand Up @@ -335,7 +332,6 @@ function getLinesFromPage(pageIndex) {
})
);
}

// Speak text with optional target voiceUri; on end, invoke callbacks and reset UI
function speakText(text, onEnd) {
if (!text || !text.trim()) text = "Warning. No readable text found.";
Expand Down Expand Up @@ -455,13 +451,12 @@ function clearAllHighlights() {
clearLineHighlight();
clearSelectedHighlights();
}

// Pause or resume speech synthesis
function readAloudMute(isPaused) {
const speechSynth = window.speechSynthesis;
isPaused ? speechSynth.resume() : speechSynth.pause();
}
// Cancel speech and remove highlights - Mircosoft Reader
// Cancel speech and remove highlights
function cancelReading() {
if (window.speechSynthesis?.speaking) {
window.speechSynthesis.cancel();
Expand Down Expand Up @@ -582,6 +577,7 @@ function clearAllHighlights() {
IsNext = false;
}
}

// Reads the next line in the PDF
private async Task NextLine()
{
Expand Down Expand Up @@ -620,6 +616,7 @@ function clearAllHighlights() {
}
ReadNextPage = true;
}

// Navigates to the previous page
[JSInvokable]
public async Task GoPreviousPage()
Expand All @@ -645,4 +642,4 @@ function clearAllHighlights() {

## See also

- [Blazor PDF Viewer example -Accessible PDF Reading]()
- [Blazor PDF Viewer example -Accessible PDF Reading](https://document.syncfusion.com/demos/pdf-viewer/blazor-server/pdf-viewer/accessible-pdf-reading?theme=fluent2)
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ The SfPdfViewer component supports importing and exporting annotations as a JSON

* Select Add or Edit annotation in the SfPdfViewer toolbar to enable the annotation tools.

![SfPdfViewer toolbar with the Edit annotation button highlighted](../../blazor-classic/images/blazor-pdfviewer-edit-button.png)
![SfPdfViewer toolbar with the Edit annotation button highlighted](../images/blazor-pdfviewer-edit-button.png)

* The annotation toolbar appears.
* Select Comment Panel in the annotation toolbar.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ documentation: ug

The SfPdfViewer control supports adding, editing, and deleting text markup annotations, including highlight, underline, strikethrough, and squiggly, in a PDF document.

![Blazor SfPdfViewer showing text markup annotations](../../blazor-classic/images/blazor-pdfviewer-text-markup-annotation.png)
![Blazor SfPdfViewer showing text markup annotations](../images/blazor-pdfviewer-text-markup-annotation.png)

## Adding text markup annotation to the PDF Document

Expand All @@ -26,7 +26,7 @@ There are two ways to highlight text in a PDF document.
* Select text in the PDF document and right-click it.
* Select the **Highlight** option in the context menu.

![Context menu with Highlight option in Blazor SfPdfViewer](../../blazor-classic/images/blazor-pdfviewer-highlight-context.png)
![Context menu with Highlight option in Blazor SfPdfViewer](../images/blazor-pdfviewer-highlight-context.png)

**Using the annotation toolbar.**

Expand Down Expand Up @@ -72,7 +72,7 @@ There are two ways to underline text in a PDF document.
* Select text in the PDF document and right-click it.
* Select the **Underline** option in the context menu.

![Context menu with Underline option in Blazor SfPdfViewer](../../blazor-classic/images/blazor-pdfviewer-underline-context-menu.png)
![Context menu with Underline option in Blazor SfPdfViewer](../images/blazor-pdfviewer-underline-context-menu.png)

**Using the annotation toolbar.**

Expand Down Expand Up @@ -118,7 +118,7 @@ Using the context menu.
* Select text in the PDF document and right-click it.
* Select the **Strikethrough** option in the context menu.

![Context menu with Strikethrough option in Blazor SfPdfViewer](../../blazor-classic/images/blazor-pdfviewer-strike-through-in-contextmenu.png)
![Context menu with Strikethrough option in Blazor SfPdfViewer](../images/blazor-pdfviewer-strike-through-in-contextmenu.png)

**Using the annotation toolbar.**

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Document-Processing/PDF/PDF-Viewer/blazor/images/ink_opacity.png
Binary file modified Document-Processing/PDF/PDF-Viewer/blazor/images/ink_tool.png