Skip to content

How to import types from pdfjs-dist/types/web/ in Angular 17? #18295

Answered by Tucaen
Tucaen asked this question in Q&A
Discussion options

You must be logged in to vote

I managed to get the project to compile by changing the imports as follows:
Old:

import { AnnotationEditorType, GlobalWorkerOptions, PDFDocumentProxy, PDFPageProxy, PageViewport, getDocument } from 'pdfjs-dist';
import { OnProgressParameters } from 'pdfjs-dist/types/src/display/api';
import { PDFViewerOptions } from 'pdfjs-dist/types/web/pdf_viewer';
import { LinkTarget, PDFFindController, PDFLinkService, PDFSinglePageViewer, PDFViewer } from 'pdfjs-dist/web/pdf_viewer';

New:

import { AnnotationEditorType, GlobalWorkerOptions, OnProgressParameters, PDFDocumentProxy, PDFPageProxy, PageViewport, getDocument } from 'pdfjs-dist';
import { PDFViewerOptions } from 'pdfjs-dist/types/web/pdf_vie…

Replies: 5 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by Tucaen
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant
Converted from issue

This discussion was converted from issue #18294 on June 19, 2024 13:38.