jsPDF icon indicating copy to clipboard operation
jsPDF copied to clipboard

Rect is missing from the type informations

Open MartinX3 opened this issue 2 years ago • 4 comments

const checkBox = new AcroFormCheckBox()

checkBox.Rect = [params.leftMargin, params.topMargin - checkboxTextHeight, checkboxLength, checkboxLength]

results into

error TS2339: Property 'Rect' does not exist on type 'AcroFormCheckBox'.

Looking into the code the Rect is missing from the type information.

MartinX3 avatar Jan 03 '24 17:01 MartinX3

Hi, I would like to work on this issue. Can you assign it to me ? @MartinX3 is it in the src/modules/acroform.js that we have to check ?

Setha77 avatar Jan 09 '24 17:01 Setha77

I don't know where to look and I also can't assign issue tickets since I'm not the owner of this project.

I also replaced the code with

checkBox.x = params.leftMargin
checkBox.y = params.topMargin - checkboxTextHeight
checkBox.width = checkboxLength
checkBox.height = checkboxLength

according to the documentation.
I don't know why online tutorials use Rect. It works, but it is not part of the documentation or the type information.
Maybe a remnant of an earlier version?

MartinX3 avatar Jan 10 '24 12:01 MartinX3

This issue is stale because it has been open 90 days with no activity. It will be closed soon. Please comment/reopen if this issue is still relevant.

github-actions[bot] avatar Apr 10 '24 01:04 github-actions[bot]

A comment from the devs would be nice. Maybe this issue can be closed because it works as intended.

MartinX3 avatar Apr 11 '24 12:04 MartinX3