Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

848600 : GitHub samples updated to the standalone PDF Viewer #10

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
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 @@ -10,7 +10,8 @@ render() {
<PdfViewerComponent
id="container"
documentPath="PDF Succinctly.pdf"
serviceUrl="https://localhost:44399/pdfviewer"
//To set up the **server-backed PDF Viewer**, add the following 'serviceUrl'.
//serviceUrl="https://localhost:44399/pdfviewer"
style={{ height: '640px' }}
>
{/*Inject required dependencies*/}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ render() {
}}
id="container"
documentPath="PDF Succinctly.pdf"
serviceUrl="https://localhost:44399/pdfviewer"
//To set up the **server-backed PDF Viewer**, add the following 'serviceUrl'.
//serviceUrl="https://localhost:44399/pdfviewer"
documentLoad={this.documentLoaded}
style={{ height: '640px' }}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ public string PerformOCR(Syncfusion.Drawing.RectangleF bounds, int PageIndex, st
PdfRenderer lDoc = new PdfRenderer();
var document = _hostingEnvironment.ContentRootPath;

lDoc.Load(@"Data\PDF_Succinctly.pdf");
lDoc.Load(@"Data\https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf");
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How did this work for you? whether we ensured the changes in local?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have changed file name

processor.Settings.Language = Languages.English;
int DPI = 300;
System.Drawing.Bitmap image = lDoc.ExportAsImage(PageIndex, DPI, DPI);
Expand Down
2 changes: 1 addition & 1 deletion Annotations/Import and export annotations/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export class App extends React.Component {
{/* Render the PDF Viewer */}
<PdfViewerComponent
id="container"
documentPath="PDF_Succinctly.pdf"
documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf"
documentLoad={this.documentLoad}
serviceUrl="https://ej2services.syncfusion.com/production/web-services/api/pdfviewer"
style={{ height: '640px' }}
Expand Down
13 changes: 10 additions & 3 deletions Custom Toolbar/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -329,9 +329,16 @@ function App() {
</div>
</div>
</div>
<PdfViewerComponent ref={(scope : any) => { viewer = scope; }} serviceUrl='https://localhost:44347/pdfviewer'
documentPath="PDF_Succinctly.pdf" style={{height:'640px'}}
enableToolbar={false} documentLoad={onDocumentLoaded} pageChange={onPageChanged}></PdfViewerComponent>
<PdfViewerComponent
ref={(scope : any) => { viewer = scope; }}
//To set up the **server-backed PDF Viewer**, add the following 'serviceUrl'.
serviceUrl='https://localhost:44347/pdfviewer'
documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf"
style={{height:'640px'}}
enableToolbar={false}
documentLoad={onDocumentLoaded}
pageChange={onPageChanged}>
</PdfViewerComponent>

<input type='file' id="fileUpload" accept='.pdf'
style={{ 'display': 'block', 'visibility': 'hidden', 'width': '0', 'height': '0'}}
Expand Down
8 changes: 7 additions & 1 deletion Getting Started/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,13 @@ import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation,
export function App() {
return (<div>
<div className='control-section'>
<PdfViewerComponent id="container" documentPath="PDF_Succinctly.pdf" serviceUrl="https://ej2services.syncfusion.com/production/web-services/api/pdfviewer" style={{ 'height': '640px' }}>
<PdfViewerComponent
id="container"
documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf"
//To set up the **server-backed PDF Viewer**, add the following 'serviceUrl'.
// serviceUrl="https://ej2services.syncfusion.com/production/web-services/api/pdfviewer"
style={{ 'height': '640px' }}>

<Inject services={[Toolbar, Magnification, Navigation, Annotation, LinkAnnotation, BookmarkView, ThumbnailView, Print, TextSelection, TextSearch, FormFields, FormDesigner]}/>
</PdfViewerComponent>
</div>
Expand Down
5 changes: 3 additions & 2 deletions How to/Get hash id from storage/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ export class App extends React.Component{
{/* Render the PDF Viewer */}
<PdfViewerComponent
id="container"
documentPath="PDF_Succinctly.pdf"
serviceUrl="https://ej2services.syncfusion.com/production/web-services/api/pdfviewer"
documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf"
//To set up the **server-backed PDF Viewer**, add the following 'serviceUrl'.
// serviceUrl="https://ej2services.syncfusion.com/production/web-services/api/pdfviewer"
style={{ height: '640px' }}
>
{/* Inject the required services */}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ return (<div>
<div className='control-section'>
<PdfViewerComponent
id="container"
// Replace PDF_Succinctly.pdf with the actual document name that you want to load
documentPath="PDF_Succinctly.pdf"
// Replace PDF_Succintly.pdf with the actual document name that you want to load
documentPath="PDF_Succintly.pdf"
// Replace the "localhost:44396" with the actual URL of your server
serviceUrl="https://localhost:44396/pdfviewer"
style={{ 'height': '640px' }}>
Expand Down
2 changes: 1 addition & 1 deletion Toolbar/How to hide toolbar/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"@syncfusion/ej2-react-pdfviewer": "^20.2.50",
"@syncfusion/ej2-react-pdfviewer": "^23.1.36",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^13.5.0",
Expand Down
15 changes: 4 additions & 11 deletions Toolbar/How to hide toolbar/src/index.js
Original file line number Diff line number Diff line change
@@ -1,26 +1,19 @@
import * as React from 'react';
import { createRoot } from 'react-dom/client';
import { PdfViewerComponent, Toolbar, Magnification, Navigation, LinkAnnotation, BookmarkView, ThumbnailView, Print, TextSelection, Annotation, TextSearch, FormFields, FormDesigner, Inject } from '@syncfusion/ej2-react-pdfviewer';
let thumbnail = [];

export class App extends React.Component {
//Event triggers on successful AJAX request
fireAjaxRequestSuccess(event) {
if (event.action === 'Load') {
thumbnail.push(event.data);
console.log(thumbnail);
}
}
render() {
return (
<div>
<div className="control-section">
{/* Render the PDF Viewer */}
<PdfViewerComponent
id="container"
documentPath="PDF_Succinctly.pdf"
ajaxRequestSuccess={this.fireAjaxRequestSuccess}
documentPath="https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf"
enableToolbar ={false}
serviceUrl="https://ej2services.syncfusion.com/production/web-services/api/pdfviewer"
//To set up the **server-backed PDF Viewer**, add the following 'serviceUrl'.
// serviceUrl="https://ej2services.syncfusion.com/production/web-services/api/pdfviewer"
style={{ height: '640px' }
}
>
Expand Down