Product: @pdftron/webviewer
Product Version: 7.3.3
Please give a brief summary of your issue:
Annotations are not being properly exported (on download or on programatic export)
Please describe your issue and provide steps to reproduce it:
We’re loading a PDF, and we insert 4 free text annotations.
Given this data:
"textFields": [
{
"content": "Temár Jordão Gomes",
"region": {
"x": 75,
"y": 530,
"width": 150,
"height": 30,
"pageNumber": 2
},
"fontSize":17
},
{
"content": "Temár Jordão Gomes",
"region": {
"x": 75,
"y": 573,
"width": 150,
"height": 30,
"pageNumber": 2
},
"fontSize":11
},
{
"content": "07/07/2020 16:42",
"region": {
"x": 75,
"y": 590,
"width": 150,
"height": 30,
"pageNumber": 2
},
"fontSize":11
},
{
"content": "TEST TIAGO",
"region": {
"x": 75,
"y": 610,
"width": 150,
"height": 30,
"pageNumber": 2
},
"fontSize":11
}
]
We apply the following:
document.textFields.forEach(textField => {
const freeText = new Annotations.FreeTextAnnotation();
freeText.PageNumber = textField.region.pageNumber;
freeText.X = textField.region.x;
freeText.Y = textField.region.y;
freeText.Width = textField.region.width;
freeText.Height = textField.region.height;
freeText.setPadding(new Annotations.Rect(0, 0, 0, 0));
freeText.setContents(replaceDatePlaceholder(textField.content));
freeText.FontSize = `${textField.fontSize || 20}pt`;
freeText.ReadOnly = true;
freeText.Locked = true;
freeText.Font = "serif";
freeText.TextAlign = "left";
freeText.TextColor = new Annotations.Color(0, 0, 0, 1);
freeText.StrokeThickness = 0;
annotManager.addAnnotation(freeText, { autoFocus: false });
annotManager.redrawAnnotation(freeText);
});
We get the following output on the screen (which is perfect):
The problem is when we try to download the document. It’s like this:
(The same problematic output occurs when we try to export it, programatically).
IMPORTANT NOTE:
This was all working perfectly on our previous version (that was using web viewer 5.x
On top of the code that I pasted, we WERE also applying the following:
annotation.setPath([
new Annotations.Point(textField.region.x, textField.region.y),
new Annotations.Point(
textField.region.x + textField.region.width,
textField.region.y + textField.region.height
)
]);
Apparently, I can no longer use this on 7.3.3 ?
Can you please help? This is a big blocker for us.