unidoc / unioffice

Pure go library for creating and processing Office Word (.docx), Excel (.xlsx) and Powerpoint (.pptx) documents
https://unidoc.io/unioffice/
Other
4.34k stars 468 forks source link

How to split a run and/or paragraph while preserving styling #492

Closed lavens closed 11 months ago

lavens commented 1 year ago

Description

In the example below, I would like to replace the text {{table_content}} with a table, and split the run that contains the text into two new runs whilst preserving any styling (lines break, font style, etc) that was applied to the original run. Any suggestions on how this can be done? Thanks!

Example Template Document

_Depending on the laws in your state, the person who writes a real estate sales contract can be the buyer or the seller. The first step of the legal process of buying or selling a home involves creating a real estate purchase agreement. The purchase agreement {{tablecontent}} outlines the terms of the sale but does not transfer the property itself — more steps come afterward to finalize a legal property transfer.

Expected Behavior

Depending on the laws in your state, the person who writes a real estate sales contract can be the buyer or the seller. The first step of the legal process of buying or selling a home involves creating a real estate purchase agreement. The purchase agreement Header Header Header Header
Cell Cell Cell Cell
Cell Cell Cell Cell

outlines the terms of the sale but does not transfer the property itself — more steps come afterward to finalize a legal property transfer.

github-actions[bot] commented 1 year ago

Welcome! Thanks for posting your first issue. The way things work here is that while customer issues are prioritized, other issues go into our backlog where they are assessed and fitted into the roadmap when suitable. If you need to get this done, consider buying a license which also enables you to use it in your commercial products. More information can be found on https://unidoc.io/

joinimran commented 1 year ago

Hi @lavens - Thank you for reporting this issue. Our development team is looking into this. We are expecting the fix as soon as possible and will share the details via internal support channel.

Thanks. Imran.

sampila commented 11 months ago

Hi @lavens,

Starting from version https://github.com/unidoc/unioffice/releases/tag/v1.26.0, we added the function for "SetProperties" where it can be used to preserving the run styles.

Best regards, Alip