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

Extension to Types/index.d.ts to allow more complete use of jsPDF from Typescript #3238

Closed
AlexanderBaruta opened this issue Aug 23, 2021 · 1 comment · Fixed by #3302
Closed
Labels

Comments

@AlexanderBaruta
Copy link

In working with jsPDF as part of the Angular Framework I have come across a couple of common jsPDF features that do not currently work in Typescript due to the Types/index.d.ts not containing the full definition of the object.

This includes the jsPDF constructor and jsPDFOptions not taking the optional parameter of hotfixes?: string[],
and the definition of ImageProperties not containing the filetype property.

I can provide a PR to fix these issues if desired.
The main use-case for the hotfixes is to allow the use of pixel-scaling and other such hotfixes
The main use-case for the image properties extension is to allow ease of use when adding images with potentially unknown filetype to the PDF document since the filetype can then be inferred from the image properties.

Attached are my notes on the issue and the modifications that I have made to my local copy of the file in order to use these interfaces
Notes.txt

@HackbrettXXX
Copy link
Collaborator

hotfixes was added in #3108 but not yet released.
The format parameter is indeed missing from the ImageProperties type (it's called format not filetype). A pull request would be appreciated, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants