ONLYOFFICE / DocumentServer

ONLYOFFICE Docs is a free collaborative online office suite comprising viewers and editors for texts, spreadsheets and presentations, forms and PDF, fully compatible with Office Open XML formats: .docx, .xlsx, .pptx and enabling collaborative editing in real time.
https://www.onlyoffice.com
GNU Affero General Public License v3.0
4.8k stars 1.08k forks source link

ApiPictureForm.ToFixed has no effect. #2319

Open cnTailor opened 1 year ago

cnTailor commented 1 year ago

This issue is unique.

Operating System of DocumentServer

Linux (DEB package)

Version information

7.2.1.34

Expected Behavior

I can change the size of an ApiTextForm using the ToFixed method, and the ToFixed method of ApiPictureForm should be the same.

Actual Behavior

The ToFixed method of ApiPictureForm has no effect. It always looks to stay the same size.This is the case with the example of the official website.

Reproduction Steps

builder.CreateFile("docx"); var oDocument = Api.GetDocument(); var oPictureForm = Api.CreatePictureForm({"key": "Personal information", "tip": "Upload your photo", "required": true, "placeholder": "Photo", "scaleFlag": "tooBig", "lockAspectRatio": true, "respectBorders": false, "shiftX": 50, "shiftY": 50}); oPictureForm.SetImage("https://api.onlyoffice.com/content/img/docbuilder/examples/user-profile.png"); var oParagraph = oDocument.GetElement(0); oParagraph.AddElement(oPictureForm); oPictureForm.ToFixed(2 240, 2 240); // the example of the official website is oPictureForm.ToFixed(10 240, 10 240); // Whether it's 2 or 10, the oPictureForm size is the same var bFixed = oPictureForm.IsFixed(); oParagraph = Api.CreateParagraph(); oParagraph.AddText("The first form from this document has a fixed size: " + bFixed); oDocument.Push(oParagraph); builder.SaveFile("docx", "ToFixed.docx"); builder.CloseFile();

Additional information

No response

l8556 commented 1 year ago

Hi @cnTailor ! Thank you for report! I created ticket #64011 with your issue.