Skip to content

Commit e145178

Browse files
Merge pull request #2316 from syncfusion-content/diataxis-changes_dev_staging
1010807: Resolving staging issues
2 parents b4c7a68 + 87e507b commit e145178

6 files changed

Lines changed: 53 additions & 20 deletions

File tree

Document-Processing/PDF/PDF-Viewer/react/depoyment-integration/gatsby.md

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,9 @@ import './src/components/layout.css';
6565

6666
5. Use a client-only approach (Gatsby is server-side rendered). A simple and reliable pattern is to render the viewer after mount with a mounted flag. Create `src/components/pdfviewer.js` with the component below (the example also shows where to register a Syncfusion license if you have one):
6767

68-
```js
68+
{% tabs %}
69+
{% highlight js tabtitle="Standalone" %}
70+
{% raw %}
6971
// src/components/pdfviewer.js
7072
import React, { useEffect, useState } from 'react';
7173
import {
@@ -99,11 +101,15 @@ export default function PdfViewer() {
99101
</div>
100102
);
101103
}
102-
```
104+
{% endraw %}
105+
{% endhighlight %}
106+
{% endtabs %}
103107

104108
Add a page that uses the component at `src/pages/index.js`:
105109

106-
```js
110+
{% tabs %}
111+
{% highlight js tabtitle="Standalone" %}
112+
{% raw %}
107113
// src/pages/index.js
108114
import React from "react";
109115
import PdfViewer from "../components/pdfviewer";
@@ -117,7 +123,9 @@ export default function PdfViewerPage() {
117123
</main>
118124
);
119125
}
120-
```
126+
{% endraw %}
127+
{% endhighlight %}
128+
{% endtabs %}
121129

122130
6. Run the Gatsby dev server:
123131

Document-Processing/PDF/PDF-Viewer/react/depoyment-integration/preact.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@ How‑to: Render a minimal `PdfViewerComponent` in `src/index.js`.
5050

5151
Prefer a single `Add component` example using the CDN `resourceUrl` (no server required). Replace the CDN version as needed.
5252

53-
```js
53+
{% tabs %}
54+
{% highlight js tabtitle="Standalone" %}
55+
{% raw %}
5456
import { render } from 'preact';
5557
import { PdfViewerComponent, Toolbar, Magnification, Navigation, Annotation, Inject } from '@syncfusion/ej2-react-pdfviewer';
5658
import './style.css';
@@ -68,7 +70,9 @@ function App() {
6870
}
6971

7072
render(<App />, document.getElementById('app'));
71-
```
73+
{% endraw %}
74+
{% endhighlight %}
75+
{% endtabs %}
7276

7377
**See also**
7478

Document-Processing/PDF/PDF-Viewer/react/depoyment-integration/remix.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,9 @@ Vite / plain React (`src/` tree)
144144

145145
Example component (works in either location):
146146

147-
```ts
147+
{% tabs %}
148+
{% highlight js tabtitle="Standalone" %}
149+
{% raw %}
148150
// components/PdfViewerClient.ts
149151
import React, { useEffect, useState } from 'react';
150152
import {
@@ -175,7 +177,9 @@ export default function PdfViewerClient() {
175177
</div>
176178
);
177179
}
178-
```
180+
{% endraw %}
181+
{% endhighlight %}
182+
{% endtabs %}
179183

180184
Routing / usage examples:
181185

Document-Processing/PDF/PDF-Viewer/react/depoyment-integration/share-point.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,9 @@ Important: ensure any host you use serves `.wasm` files with Content-Type `appli
9292

9393
Create `PdfViewerClient.tsx` under `src/webparts/pdfViewer/components` and paste the minimal example below. This component is client-only and safe for SPFx (which runs in the browser):
9494

95-
```ts
95+
{% tabs %}
96+
{% highlight js tabtitle="Standalone" %}
97+
{% raw %}
9698
// src/webparts/pdfViewer/components/PdfViewerClient.tsx
9799
import * as React from 'react';
98100
import {
@@ -125,7 +127,9 @@ export const PdfViewerClient: React.FC = () => {
125127
};
126128

127129
export default PdfViewerClient;
128-
```
130+
{% endraw %}
131+
{% endhighlight %}
132+
{% endtabs %}
129133

130134
## Step 6 — Use the component in the web part
131135

Document-Processing/PDF/PDF-Viewer/react/open-pdf-files.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ This simple example demonstrates the minimal steps to show a PDF document in the
2020
2. Set `documentPath` to a publicly accessible URL.
2121

2222
Example (TypeScript / React):
23-
```ts
23+
{% tabs %}
24+
{% highlight js tabtitle="Standalone" %}
25+
{% raw %}
2426
import * as React from 'react';
2527
import * as ReactDOM from 'react-dom/client';
2628
import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, BookmarkView, ThumbnailView,
@@ -41,12 +43,15 @@ function App() {
4143

4244
const root = ReactDOM.createRoot(document.getElementById('sample') as HTMLElement);
4345
root.render(<App />);
44-
```
46+
{% endraw %}
47+
{% endhighlight %}
48+
{% endtabs %}
4549

4650

4751
## Open PDF Files Using Different Source Types
4852

4953
Below are concise instructions and short snippets for loading PDFs from several source types. Each subsection links to or describes the minimal approach — keep these pages as focused how-to guides if you expand them.
54+
5055
### Open PDF from URL
5156

5257
- Set [`documentPath`](https://ej2.syncfusion.com/react/documentation/api/pdfviewer/index-default#documentpath) to the external URL (see example above).
@@ -81,7 +86,7 @@ fetch(url)
8186
```
8287
8388
84-
### Open PDF from database
89+
### Open PDF from database
8590
8691
To load a PDF file from SQL Server database in a PDF Viewer, you can follow the steps below
8792
@@ -190,7 +195,7 @@ fetch(url)
190195
191196
[View sample in GitHub](https://github.com/SyncfusionExamples/open-save-pdf-documents-in-database)
192197
193-
### Open from Cloud Storage Services
198+
### Open from Cloud Storage Services
194199
195200
Each link goes to a provider page with simple step-by-step instructions, sample code, and any authentication notes.
196201
@@ -204,7 +209,7 @@ Each link goes to a provider page with simple step-by-step instructions, sample
204209
205210
---
206211
207-
See also:
212+
**See also**
208213
209214
210215
- [Load documents dynamically in React PDF Viewer](./how-to/load-document)

Document-Processing/PDF/PDF-Viewer/react/save-pdf-files.md

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,9 @@ public IActionResult Download([FromBody] Dictionary<string, string> jsonObject)
7171

7272
Set the `serviceUrl` to point to your web service (for example, replace `https://localhost:44396/pdfviewer` with your server URL). Also set `documentPath` to the document URL you want to load.
7373

74-
```js
74+
{% tabs %}
75+
{% highlight js tabtitle="JSX" %}
76+
{% raw %}
7577
import * as ReactDOM from 'react-dom';
7678
import * as React from 'react';
7779
import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, BookmarkView, ThumbnailView,
@@ -97,15 +99,19 @@ function App() {
9799
}
98100
const root = ReactDOM.createRoot(document.getElementById('sample'));
99101
root.render(<App />);
100-
```
102+
{% endraw %}
103+
{% endhighlight %}
104+
{% endtabs %}
101105

102106
[View sample in GitHub](https://github.com/SyncfusionExamples/react-pdf-viewer-examples/tree/master/Save%20and%20Load/Save%20PDF%20file%20to%20server)
103107

104108
## Download PDF file as a copy
105109

106110
The built-in toolbar includes a download option that saves the updated PDF to the user's local file system. You can also trigger the same behavior programmatically by calling the viewer's [`download()`](https://ej2.syncfusion.com/react/documentation/api/pdfviewer/index-default#download) API.
107111

108-
```js
112+
{% tabs %}
113+
{% highlight js tabtitle="JSX" %}
114+
{% raw %}
109115
import * as ReactDOM from 'react-dom/client';
110116
import * as React from 'react';
111117
import './index.css';
@@ -139,7 +145,9 @@ return (<div>
139145
}
140146
const root = ReactDOM.createRoot(document.getElementById('sample'));
141147
root.render(<App />);
142-
```
148+
{% endraw %}
149+
{% endhighlight %}
150+
{% endtabs %}
143151

144152
## Save modified PDF to a database
145153

@@ -247,7 +255,7 @@ Each link below goes to a provider page with simple, step-by-step instructions a
247255
- [Azure AD (auth notes)](./save-pdf-file/to-azure-active-directory)
248256
---
249257

250-
See also:
258+
**See also**
251259

252260
- [Get Base64 value from a loaded PDF using saveAsBlob API](./how-to/get-base64)
253261
- [Open PDF files overview](./open-pdf-files)

0 commit comments

Comments
 (0)