I am currently developing a plugin for Word documents, where my goal is to insert an image inside a table cell using code. Here’s the snippet I’m using:
let oCell = oTable.GetCell(rowIndex, 0);
let cellContent = oCell.GetContent();
let cellParagraph = cellContent.GetElement(0);
cellParagraph.RemoveAllElements();
However, I’ve encountered an issue where sometimes the image inserts correctly, while other times an image with a cross mark over it gets inserted. How can I resolve this issue?
I am encountering the described issue only when fetching data from an API and extracting image URLs from the API response. Occasionally, the image insertion is successful, but on other occasions, a cross is displayed instead of the image. Additionally, when I download the document, I notice that the image with a cross is initially inserted, but when the document is opened, the image is available. This problem seems to be related to a potential bug in the Office Web application for the DOCX file format. Below, I have included my complete code for reference:
I am using the OnlyOffice web version and encountering an issue with all the images.It seems that the problem arises when I fetch data from the server using the JavaScript ‘fetch’ method. Strangely, when I use hardcoded image URLs or base64 encoding, everything works fine without any hitches. Additionally, the AddDrawing() method returns true. However, when I download a document containing an image with a cross symbol, the downloaded document displays the actual image without any issue. I suspect that there might be a bug causing the intermittent inability to add images when the document is opened in the online version of OnlyOffice for text documents. Furthermore, when I attempt to run the same plugin in the OnlyOffice desktop version, it throws a 405 error for the API call using the fetch method. I have provided the code to fetch data and add images above in this thread.
In the provided video, when I click on my plugin’s refresh button, all the data loads correctly in the document. However, the images are not displayed initially; they only become visible after I manually refresh the document.
Which product ONLYOFFICE are you using and the version of the document server.
Open your browser’s console (press F12 in Google Chrome). Check if there are any error entries in the ‘Console’ and ‘Network’ tabs. Please take screenshots.
I am using OnlyOffice for Docs (web version) through the https://personal.onlyoffice.com/. I am not currently using the document server and have built a plugin using the document builder. I am directly uploading my add-in to Chrome extensions and starting to use it in the OnlyOffice web application.
I haven’t found any issues in the network or console.
Can you please check this link again: plugin It’s not working when I have multiple bookmarks. The callCommand method is called only once. Additionally, I want to call another API from the loadCompanyFinancials method (availble inside plugin) and update the bookmark value based on that API response. How can I implement this in this scenario?
We have done our utmost to address the issues you’ve encountered within the forum. We even made modifications to the plugin you provided. If you still require further assistance, please don’t hesitate to reach out to dedicated support post: Get dedicated support.