Stack Exchange network consists of 176 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
A question asking about a way to accomplish some e-book specific task in a programming language seems to be on-topic both here, and on StackOverflow/Programmers.
Example: this one.
Are such questions on-topic here?
I would say yes. This site is intended both for users of e-book and e-reader software as well as publishers creating content for e-books and e-readers. Therefore, at least from a broad point-of-view, programming questions should be on-topic.
I also would say yes although that particular is not the greatest.