Open enoh-barbu opened 1 year ago
I have implemented a workaround solution
pdfDoc.getForm().getFields().forEach((field) => {
page.node.Annots()?.asArray().forEach((annot) => {
if ((annot as PDFRef).objectNumber === field.acroField.ref.objectNumber) {
const widgets = field.acroField.getWidgets();
widgets.forEach((widget) => {
const rect = widget.getRectangle();
rect.x += translateX;
rect.y += translateY;
widget.setRectangle(rect);
});
}
});
});
What were you trying to do?
I'm trying to scale a page which contains a form with different fields, text/checkbox etc
How did you attempt to do it?
page.scale(scale, scale); page.translateContent(translateX, translateY);
What actually happened?
The form fields are not translated as the rest of the page content.
What did you expect to happen?
The form fields should have been translated as well (X/Y)
How can we reproduce the issue?
page.scale(0.8, 0.8); page.translateContent(translateX, translateY); OoPdfFormExample.pdf
Version
1.17.1
What environment are you running pdf-lib in?
Node
Checklist
Additional Notes
No response