-
-
Notifications
You must be signed in to change notification settings - Fork 12
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
"replaceText" not working #82
Comments
Hi! It is because ppt separates the text into three xml elements: <a:p>
<a:r>
<a:rPr lang="de-DE" sz="2000" i="1" dirty="0">
<a:solidFill>
<a:schemeClr val="accent6"/>
</a:solidFill>
</a:rPr>
<a:t>{ </a:t>
</a:r>
<a:r>
<a:rPr lang="de-DE" sz="2000" i="1" dirty="0" err="1">
<a:solidFill>
<a:schemeClr val="accent6"/>
</a:solidFill>
</a:rPr>
<a:t>CustomerName</a:t>
</a:r>
<a:r>
<a:rPr lang="de-DE" sz="2000" i="1" dirty="0">
<a:solidFill>
<a:schemeClr val="accent6"/>
</a:solidFill>
</a:rPr>
<a:t> }</a:t>
</a:r>
<a:endParaRPr lang="de-DE" dirty="0"/>
</a:p> Altough there is You can try a workaround:
This will not make any visible difference, but join the xml elements. This was first bubbling up in #73 . Please let me know if this helps. Any help on |
I see there is a difference: |
I did try the solution you mentioned earlier. Somehow I did not work. What I did now, is that I deleted the placehoder and re-added it to PPT. Now it worked fine. We can close the issue. Thanks for your help. Is there a way, we view the ppt xml so that it is easy to debug. |
You could try I'm happy to help 😃 |
I identified the underlying issue. I utilized an existing PowerPoint (PPT) file as a template and included curly brackets around a placeholder string that was already present in the presentation. This unintentionally resulted in the creation of three distinct components ('{', 'placeholder string', '}'), as shown by you above. Consequently, the replaceText function did not function as expected. It might be beneficial to include this information in a troubleshooting guide to help others avoid encountering a similar issue in the future. |
Thanks a lot for your feedback. In my point of view, this is a bug, because your approach should work on all text elements. At the moment, I won't go deeper into this, because the workaround is very simple. |
It could also help to disable spell checking for |
Environment - node.js version v21.0.0
OS - Mac
The package is very useful. Thanks for open-sourcing it.
I am trying to use the software to generate PPTX file from a template file. The "ReplaceText" function is not working as expected.
I tried to debug the code. But could not find any method that gives me text in an element.
Please find attached sample code I am using for my testing.
agreement-ppt.zip
The text was updated successfully, but these errors were encountered: