Angular 7 PDF查看器未显示pdf文件

时间:2020-07-22 09:30:05

标签: angular pdf-viewer

在我的项目中,我从Amazon获取文件。文件始终会从Amazon成功上载,但不会始终显示,并且在控制台中未显示时,我会看到此警告

Warning: Name token is longer than allowed by the spec: 148
Warning: Name token is longer than allowed by the spec: 204
Warning: Name token is longer than allowed by the spec: 148
Warning: Indexing all PDF objects

代码看起来像这样

      <div class="files-list">
        <div class="row">
          <div class="col-md-2" *ngFor="let file of files">
            <div class="thumbnail">
              <pdf-viewer *ngIf="file['file_path']"
                          [page]="1"
                          [src]="file['file_path']"
                          [show-all]="false"
                          [original-size]="false"
                          [show-borders]="true"
                          style="display: block; height: 210px"
              ></pdf-viewer>
              <span class="file-name" *ngIf="file.type === 'application/pdf'">{{ file?.name }}</span>
              <span class="file-name" *ngIf="file.type !== 'application/pdf'">{{ file?.name.slice(11) }}</span>
            </div>
            <br>
          </div>
        </div>
      </div>

我不明白为什么有时显示文件,有时却不显示,如果我提供的不是静态网址,那么文件总是显示为 file ['file_path'] 。 谁能证明我做得不好,请先谢谢。

0 个答案:

没有答案