Skip to content

Conversation

@fsolleza
Copy link

Hi,

I added a little bit of code and two tests associated with that code so that users can add alt text to inline shapes.

The API is consistent with InlineShape.height and InlineShape.width without modifying the InlineShape initializer or changing the add_picture method. This change was based off comments in #227.

Users can add alt text as follows:

from docx import Document

doc = Document(path)
pic = doc.add_picture(picture_path, cx, cy)
pic.alt_text = "some alt text"

I'm happy to take any input and make changes where you deem necessary.

Thanks!

@fsolleza fsolleza closed this Aug 31, 2016
@scanny scanny changed the title Shape alt text feature: Shape.alternative_text Aug 31, 2016
@scanny
Copy link
Contributor

scanny commented Aug 31, 2016

Hi @fsolleza: reopening this one (with slightly changed name) to serve as a feature request for Shape.alternative_text.

@scanny scanny reopened this Aug 31, 2016
@neuhausr
Copy link

Hi, this is something I would also find useful (alt-text is necessary for document accessibility). Do you know if something else needs to be done to merge this change? Thanks!

@jeffreinhart
Copy link

Also interested in seeing this merged. Thanks!

@yosukefk
Copy link

Just clone repo, fetch this pr, and it worked as advertized. So it would be nice if this got merged to master.

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

Successfully merging this pull request may close these issues.

5 participants