adf-viewer-extension not working

cancel
Showing results for 
Search instead for 
Did you mean: 
michael-chan
Member II

adf-viewer-extension not working

 

I am trying the `adf-viewer-extension` but seems it's not reflecting.
Does anyone have idea?

My adf package version is 4.8.0.
(It works for other files like pdf, csv, png/jpg. I just want to explore if I can display word file.)

Screenshot 2022-07-21 at 12.46.45 PM.png

<adf-viewer
  id="dw-viewer-id"
  [(showViewer)]="showViewer"
  [displayName]="name"
  [blobFile]="content"
  (showViewerChange)="onViewerVisibilityChanged()"
>
  <adf-viewer-extension [supportedExtensions]="['doc', 'docx']" #extension>
    <ng-template let-urlFileContent="urlFileContent" let-extension="extension">
      <div>word</div>
    </ng-template>
  </adf-viewer-extension>

  <adf-viewer-more-actions *ngIf="enableDownload" id="dw-viewer-more-action-id">
    <button mat-menu-item (click)="downloadContent()">
      <mat-icon>file_download</mat-icon>
      <span>{{ 'ADF_VIEWER.ACTIONS.DOWNLOAD' | translate }}</span>
    </button>
  </adf-viewer-more-actions>
</adf-viewer>

 

 

2 Replies
KarekMedAM
Active Member II

Re: adf-viewer-extension not working

It seems to me that your problem has nothing to do with ADF. Make sure your local transformation services are up and running correctly (especially libreoffice) 

mohib
Member II

Re: adf-viewer-extension not working

 

This issue is coming while using blobFile in ADF viewer, you should try this... 

<adf-viewer
  id="dw-viewer-id"
  [(showViewer)]="showViewer"
  [displayName]="name"
  [blobFile]="content"
  (showViewerChange)="onViewerVisibilityChanged()"
#adfviewer .....

@ViewChild('adfviewer', { static: false }) 
adfviewer: ViewerComponent;

private changeDetectorRef: ChangeDetectorRef
....
if(this.content){ //blob content
this.changeDetectorRef.detectChanges();
this.adfviewer.viewerType = 'custom';
this.adfviewer.extensionTemplates[0].isVisible = true; // forcefully assign 1st template for blobFile value.
const url = URL.createObjectURL(this.content); // create blob url
this.adfviewer.urlFileContent = url;
}