What happened?
What happened?
When converting floating images using editor.doc.images.convertToInline(), the API reports success and the image's placement changes from floating to inline.
However, the resulting layout does not match the expected inline flow.
Expected
A floating image converted to inline should appear as a normal inline image in the document flow, for example:
Paragraph A
[Image]
Paragraph B
or otherwise preserve Word's visual reading order.
Actual
The image is inserted into its original anchor paragraph, causing surrounding text to flow beside the image.
For example:
data data: Normal...
[Image]data data datas...
Right data data...
instead of
dat data dat: Normal...
[Image]
data data data data ...
Right datadata...
The API returns:
{
"success": true,
"image": {
"kind": "inline",
"nodeType": "image",
"nodeId": "...",
"placement": "inline"
}
}
and images.list() confirms the image placement is now "inline".
So the conversion succeeds, but the resulting layout is unexpected.
Steps to reproduce
Steps to reproduce
Open a DOCX containing floating images with square text wrapping.
Call:
const { items } = editor.doc.images.list();
for (const img of items) {
editor.doc.images.convertToInline({
imageId: img.sdImageId,
});
}
Observe the rendered document.
The image becomes inline but remains embedded in its original anchor paragraph, causing text to wrap beside it instead of appearing before and after the image.
SuperDoc version
1.43.2
Browser
Chrome
Additional context
Additional context
The image metadata before conversion is:
{
"properties": {
"placement": "floating",
"wrap": {
"type": "Square"
}
}
}
After conversion:
{
"success": true,
"image": {
"placement": "inline"
}
}
What happened?
What happened?
When converting floating images using editor.doc.images.convertToInline(), the API reports success and the image's placement changes from floating to inline.
However, the resulting layout does not match the expected inline flow.
Expected
A floating image converted to inline should appear as a normal inline image in the document flow, for example:
Paragraph A
[Image]
Paragraph B
or otherwise preserve Word's visual reading order.
Actual
The image is inserted into its original anchor paragraph, causing surrounding text to flow beside the image.
For example:
data data: Normal...
[Image]data data datas...
Right data data...
instead of
dat data dat: Normal...
[Image]
data data data data ...
Right datadata...
The API returns:
{
"success": true,
"image": {
"kind": "inline",
"nodeType": "image",
"nodeId": "...",
"placement": "inline"
}
}
and images.list() confirms the image placement is now "inline".
So the conversion succeeds, but the resulting layout is unexpected.
Steps to reproduce
Steps to reproduce
Open a DOCX containing floating images with square text wrapping.
Call:
const { items } = editor.doc.images.list();
for (const img of items) {
editor.doc.images.convertToInline({
imageId: img.sdImageId,
});
}
Observe the rendered document.
The image becomes inline but remains embedded in its original anchor paragraph, causing text to wrap beside it instead of appearing before and after the image.
SuperDoc version
1.43.2
Browser
Chrome
Additional context
Additional context
The image metadata before conversion is:
{
"properties": {
"placement": "floating",
"wrap": {
"type": "Square"
}
}
}
After conversion:
{
"success": true,
"image": {
"placement": "inline"
}
}