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

textbox properties #403

Open
miklaiti opened this issue Oct 24, 2014 · 7 comments
Open

textbox properties #403

miklaiti opened this issue Oct 24, 2014 · 7 comments

Comments

@miklaiti
Copy link

miklaiti commented Oct 24, 2014

Is it possible to give textbox background color?


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@playmono
Copy link

Same question here.

@horan-geeker
Copy link

The Same question

@TorpedoCXC
Copy link

Same question.

@kjrose
Copy link

kjrose commented Feb 13, 2019

From what I can see there is no way to do this since TextBox inherits from Image (ref https://github.com/PHPOffice/PHPWord/blob/develop/src/PhpWord/Style/TextBox.php) which inherits from Frame (https://github.com/PHPOffice/PHPWord/blob/develop/src/PhpWord/Style/Image.php).

to me this is a clear deficiency in this library, and would require some work. They would need to have TextBox Style implement the Fill abstraction (https://github.com/PHPOffice/PHPWord/blob/develop/src/PhpWord/Style/Fill.php) and then update the output to handle it.

From what I can see (https://github.com/PHPOffice/PHPWord/blob/develop/src/PhpWord/Writer/Word2007/Element/TextBox.php) It does not look like there is any implementation for outputting a background color whatsoever for the textbox class. So it would be necessary to add that for all of the writer classes as well, using the "Shading" model likely (https://github.com/PHPOffice/PHPWord/blob/develop/src/PhpWord/Writer/Word2007/Style/Shading.php)

So yeah... Something for folks to do when they want.

@kjrose
Copy link

kjrose commented Feb 13, 2019

A workaround is to use a table, with a single cell.

@ahmed-bhs
Copy link

@kjrose ofr the table with a single cell is it possible to achieve rounding (broder radius) ?

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If this is still an issue for you, please try to help by debugging it further and sharing your results.
Thank you for your contributions.

@github-actions github-actions bot added the Stale label Nov 18, 2022
@Progi1984 Progi1984 removed the Stale label Nov 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

7 participants