Skip to content

Commit 27eb2ff

Browse files
1010807: Added missing API referernce links
1 parent 7f23a22 commit 27eb2ff

2 files changed

Lines changed: 22 additions & 7 deletions

File tree

Document-Processing/PDF/PDF-Viewer/react/context-menu/builtin-context-menu.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,19 @@ The React PDF Viewer includes a context-sensitive menu that updates dynamically
1717
Menu items vary depending on the target element:
1818

1919
* **Text**: Displays options to annotate and copy selected text.
20+
2021
![context menu on text](../images/context-menu-text.png)
22+
2123
* **Annotations**: Provides options to copy, cut, paste, or remove annotations, and add comments.
24+
2225
![context menu on annotation](../images/context-menu-annotation.png)
26+
2327
* **Form Fields**: Shows standard form field interactions, such as modifying properties. The context menu for form fields appears only when the viewer is in **designer mode**.
28+
2429
![context menu on form fields](../images/context-menu-forms.png)
30+
2531
* **Empty Space**: Displays the option to paste a previously copied annotation or form field.
32+
2633
![context menu on empty space](../images/context-menu-empty.png)
2734

2835
## Default Item Reference
@@ -57,7 +64,7 @@ The following items are available when interacting with annotations:
5764
These items appear when the viewer is in designer mode and a form field is selected:
5865

5966
| Item | Description |
60-
| :--- | : :--- |
67+
| :--- | :--- |
6168
| **Copy** | Copies the selected form field for duplication. |
6269
| **Cut** | Removes the selected form field for relocation. |
6370
| **Paste** | Pastes a copied or cut form field. |

Document-Processing/PDF/PDF-Viewer/react/context-menu/custom-context-menu.md

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ The PDF Viewer supports extensive customization of the context menu, including r
1414

1515
## Add Custom Context Menu Items
1616

17-
You can add custom options to the context menu using the [addCustomMenu()](https://ej2.syncfusion.com/react/documentation/api/pdfviewer#addcustommenu) method. This is typically implemented during the `documentLoad` event.
17+
You can add custom options to the context menu using the [addCustomMenu()](https://ej2.syncfusion.com/react/documentation/api/pdfviewer#addcustommenu) method. This is typically implemented during the [`documentLoad`](https://ej2.syncfusion.com/react/documentation/api/pdfviewer#documentload) event.
1818

1919
### Implementation Guide
2020

2121
1. Define the menu items as an array of objects.
22-
2. Call the `addCustomMenu` method within the `documentLoad` event handler.
22+
2. Call the [`addCustomMenu`](https://ej2.syncfusion.com/react/documentation/api/pdfviewer#addcustommenu) method within the [`documentLoad`](https://ej2.syncfusion.com/react/documentation/api/pdfviewer#documentload) event handler.
2323

2424
```jsx
2525
export function App() {
@@ -314,12 +314,20 @@ root.render(<App />);
314314

315315
## Disable the Context Menu Entirely
316316

317-
The context menu in the PDF Viewer can be fully disabled by setting the `enableContextMenu` property to `false`.
317+
The context menu in the PDF Viewer can be fully disabled by setting the [`contextMenuOption`](https://ej2.syncfusion.com/react/documentation/api/pdfviewer#contextmenuoption) property to `None`.
318318

319319
```js
320320
<PdfViewerComponent
321-
id="container"
322-
enableContextMenu={false}>
321+
id="pdfViewer"
322+
documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf"
323+
height="100%"
324+
width="100%"
325+
contextMenuOption='None' >
326+
<Inject
327+
services={[
328+
Toolbar, Magnification, Navigation, LinkAnnotation, BookmarkView, ThumbnailView, Print, TextSelection, TextSearch, Annotation, FormDesigner, FormFields
329+
]}
330+
/>
323331
</PdfViewerComponent>
324332
```
325333

@@ -341,6 +349,6 @@ The following is the output of the custom context menu with customization.
341349
N> To set up the **server-backed PDF Viewer**, add the following `serviceUrl` within the <div> element in either the `index.TSX` or `index.JSX` file:
342350
**serviceUrl="https://document.syncfusion.com/web-services/pdf-viewer/api/pdfviewer"**.
343351

344-
{% previewsample "Document-Processing/code-snippet/pdfviewer/react/custom-context-menu/index.html" %}
352+
{% previewsample "document-Processing/code-snippet/pdfviewer/react/custom-context-menu" %}
345353

346354
[View sample in GitHub](https://github.com/SyncfusionExamples/react-pdf-viewer-examples/tree/master/How%20to/Custom%20Context%20Menu)

0 commit comments

Comments
 (0)