@@ -10,19 +10,19 @@ import { DialogComponent } from '@syncfusion/ej2-angular-popups';
1010} )
1111export class AppComponent {
1212 title = 'file-manager-integration' ;
13- public hostUrl : string = 'https://ej2-aspcore-service.azurewebsites.net /' ;
13+ public hostUrl : string = 'https://localhost:44352 /' ;
1414 public ajaxSettings : object = {
15- url : this . hostUrl + 'api/FileManager/FileOperations'
15+ url : this . hostUrl + 'api/FileManager/FileOperations' ,
16+ getImageUrl : this . hostUrl + 'api/FileManager/GetImage' ,
17+ uploadUrl : this . hostUrl + 'api/FileManager/Upload' ,
18+ downloadUrl : this . hostUrl + 'api/FileManager/Download'
1619 } ;
20+
1721 public service = 'https://ej2services.syncfusion.com/production/web-services/api/pdfviewer' ;
1822 public document = 'PDF_Succinctly.pdf' ;
1923 public docContainer : DocumentEditorContainerComponent | undefined ;
2024 public dialog : DialogComponent | undefined ;
2125
22- public ngOnInit ( ) : void {
23- this . dialog ?. hide ( ) ;
24- }
25-
2626 fileOpen ( args : FileOpenEventArgs ) {
2727 const fileDetailsObj : any = args . fileDetails ! ;
2828 let fileName : string = fileDetailsObj [ "name" ] ;
@@ -31,8 +31,8 @@ export class AppComponent {
3131
3232 if ( fileType == '.pdf' ) {
3333 let responseText : any = this . getFileStream ( filePath , true ) ;
34- var pdfviewer = ( < any > document . getElementById ( 'pdfViewer' ) ) . ej2_instances [ 0 ] ;
35- pdfviewer . load ( responseText , null ) ;
34+ // var pdfviewer = (<any>document.getElementById('pdfViewer')).ej2_instances[0];
35+ // pdfviewer.load(responseText, null);
3636 }
3737 else if ( fileType == '.docx' ) {
3838 // let responseText: any = this.getFileStream(filePath, false);
@@ -55,7 +55,16 @@ export class AppComponent {
5555 ajax . onreadystatechange = ( ) => {
5656 if ( ajax . readyState === 4 ) {
5757 if ( ajax . status === 200 || ajax . status === 304 ) {
58- return ajax . responseText ;
58+ if ( ! isPDF ) {
59+ // open SFDT text in document editor
60+ // this.container.documentEditor.open(ajax.responseText);
61+ } else {
62+ var pdfviewer = ( < any > document . getElementById ( 'pdfViewer' ) )
63+ . ej2_instances [ 0 ] ;
64+ pdfviewer . load ( ajax . responseText , null ) ;
65+ //opens the file in pdf viewer
66+ //this.pdfView.load(ajax.responseText, null);
67+ }
5968 }
6069 }
6170 return null ;
0 commit comments