Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

changepic of block of images #35

Open
marcusvinicus opened this issue May 2, 2024 · 1 comment
Open

changepic of block of images #35

marcusvinicus opened this issue May 2, 2024 · 1 comment

Comments

@marcusvinicus
Copy link

Hi im trying to use a array of images like in the demo example, but i.m having some problems. I´m using the same code of the demo but i cant change the alt text of image that just stop work. I going explain what is going on below:

when i use the exactily image of docx, without change any thing in the image alt text, its work properly , but If change anything in alttext of the image, dont work anymore, even if in the end, the content of the alt text of the image is the same. its happens because when anyone save the document, the document.xml of the docx changes. So i did a diff with the document.xml of the docx documents, with exactly the same content and in result is show below:

image
the red is of the original docx, with the original image of the demo example
the green is of the saved docx, with the same content in alt text of the image, but i saved as a new docx file

to discover where is the problem i resolve to modifie the document.xml and recover docx document to make a merge thats workout. And i realized that when a leave only one "descr" attribute in document.xml reference the image that will iterate in array it workout.

Could be in first time that descr attribute appear in document.xml or second, both works since i leave only one reference.

Example:
Works:
image

works:
image

dont work
image

I have no ideia how can i solve this problem! cause i need to leave docx model free for changes.

@marcusvinicus marcusvinicus changed the title changepic of block os images changepic of block of images May 2, 2024
@Skrol29
Copy link
Owner

Skrol29 commented May 8, 2024

Hi @marcusvinicus ,

The behavior is that Ms Word (and Excel, and PowerPoint) add duplicated information when saving the document, in order to enforce compatibility with other versions. In your case, the descr attribute of the <wp:docPr> is duplicated into a <pic:cNvPr>.

But OpenTBS should deal with that.
(The problem is detailed in the source code, closed to the keyword pic:cNvPr)

Do you have the last version of OpenTBS ?
Does is work if you take off the adjust parameter ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants