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

DOCX, the margin of dynamic text/data elements will be calculated doubled #1899

Closed
speckyspooky opened this issue Sep 7, 2024 · 1 comment · Fixed by #1900
Closed

DOCX, the margin of dynamic text/data elements will be calculated doubled #1899

speckyspooky opened this issue Sep 7, 2024 · 1 comment · Fixed by #1900
Assignees
Labels
BugFix Change to correct issues
Milestone

Comments

@speckyspooky
Copy link
Contributor

Currently the Word emitter of DOCX calculate the margin of dynamic text elements like "text, "dynamic text" and "data elements" doubled. All elements which will be handled like embedded HTML elements have this problem.

The reason of it is that the word emitter creates currently a layout grid to simulate the margin based on the element style.
At the same time the embedded HTML text create his own layout based on the same style of the HTML element
(internally called "foreign text").

The result is doubled calculated margin.

Example of the double calculation of the margin:

grafik

I will provide a PR for that issue.

@speckyspooky speckyspooky added the BugFix Change to correct issues label Sep 7, 2024
@speckyspooky speckyspooky added this to the 4.17 milestone Sep 7, 2024
@speckyspooky speckyspooky self-assigned this Sep 7, 2024
@speckyspooky
Copy link
Contributor Author

The PR change the internal handling of the HTML-interpretation of the text elements.
The DOCX emitter wrap the foreign text into an HTML-data stream and embed this part as an MHT-archive on DOCX.
This part will be transformed from Word to standard Word-elements.
By default the MHT-style would include the same margin the which was rendered through the wrapper table.
The PR set the foreign-text margin (left & right) to "0px" and so the doubled spacing after & before will be avoid.

grafik

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

Successfully merging a pull request may close this issue.

1 participant