 Hello! This talk will be about the new E-Pub export filter in Ebrofisriter. Just shortly about myself, I have been involved with this codebase for a number of years now. My pet area is writer, so I was happy to hear that there is an opportunity to implement a new export filter in the form of the E-Pub export. I keep mentioning that in Ebrofisriter, but that's a writer export filter, so far this is only limited to writer. So why do we need one more export filter, making the Ebrofisriter codebase even more bloated? The motivation is that if you have some mobile phone or tablet or ear reader or something like that, your use case E-Pub is kind of the new PDF. PDF is not going away, it's still a very nice format when you have some larger screen, but it's not very good at reflowable text handling. So instead what we have is E-Pub, which is designed exactly for this use case. So as you probably know, Ebrofisriter has pretty good PDF export feature. So wouldn't it be nice if it would support exporting to E-Pub as well directly as a native feature. Previously you could export to some other format and then use some second tool to convert from that format to E-Pub. The problem is that all of these are loosey conversions, so the more items you have in your pipeline at the end and perhaps the end result is not even something you can recognize. So it's good to limit the number of build blocks you use, so directly exporting from Ebrofisriter itself has its own benefit. Regarding the state of this work, the recently released Ebrofis 6.0 has basic support and the 6.1 will have much improved support. The good thing is that ebooks are kind of books and I was told that a good book does not have much formatting, so the formatting does not distract from the actual content, which means that basic support should work for good books already. And if you need some more improved support then maybe you should refine your book. In any case, for the rest of this talk I will talk about features which are not just basic tech support with just a minimal set of character formatting like bold and italics and the minimal set of paragraph formatting like adjusting it to be centered or some paragraph spacing and something easy like this, but more complicated features. So from now on all of these will be shipped in 6.1. One frequently used feature in ebooks is hyperlinks. So this was the first non-basic tech feature I was focusing on, but to be able to fully handle hyperlinks you need to have support for all these paragraph and character styles and all the inheritance of that and so on. But at the end we have some hyperlink support and hopefully at the end it will end up in your EPUB result the way you saw it in writer. There comes table support where you can have a set of properties on the table itself at least from the writer perspective then it would be just rows and inside the rows you have the size and so you have the table properties, row properties and cell properties but from a high level point of view you also have column properties and then you can have the row spans, column spans and various properties on this. With the current master Libreface these examples are working nicely. These are screenshots from EPUB readers and it's not hard to construct something similar in a writer. The other new feature is much better image support. 6.0 has support for simple inline images which I mostly added because I wanted to test the part of the exporter that assembles the EPUB package and for that I wanted to have a use case for the binary content so I added the minimal image support where the inline images or ask character encode images are a good fit because they don't have special positioning which can be complex. But now in 6.1 you can have much better support for this the various image borders, image wrap types and image encode types that's all supported or at least considerable amount of combination of this and again from a user's point of view a caption on an image is just one more property of the image and this is something that EPUB use a lot. Technically that's a tax frame and the tax frame contains an image and with some additional tax and that tax contains tax fields so all of these building blocks are implemented too at the end you will just see a working caption support for images. Then the next one is font embedding which is pretty frequently used for ebooks the nice thing is that for the font binary format what we have in ODF can be transferred to EPUB as is so no manipulation of the font data itself is necessary and here is some very tiny screenshot of some special font that was not available on my system and that's again a screenshot from some EPUB reader. Then we come to features where the writer document itself does not really have a concept for but the EPUB specification has the first example is cover images the writer don't really set the cover image on a document if we generate thumbnails done we just paint the first page of the document to a metafile and we work with that so as part of the export options you can specify a cover image the export options is a dialogue that used to be very simple and as I added more and more features now it's relatively complex but you can set there is the version of the EPUB EPUB 3 and EPUB 2 are two major versions which are interesting EPUB 3 is what we default to then you can define how do you want to split your document into EPUB sections we default to just splitting by having one styles but if you have some plaintext import with a document then perhaps splitting on page breaks explicit page breaks is a better setting also there is support for the reflowable layout which is the default and there is also an EPUB fixed layout which is a bit odd like if we want fixed layout then why don't you use PDF but I will come back to that later and you have an explicit user interface to specify a custom cover image and various metadata for the custom metadata as part of the EPUB export is interesting because you may want to export to EPUB some classic book where you are not the author of the book but if you look at that writer document then for that document you are the author so it makes sense to be able to specify a custom author just as part of the EPUB export then one more new feature is support for food notes and image popups for both of these the point is that you click on an image or some text and some popup appears that displays some additional content and your original position is not lost so you can close this and get back to continue reading the document one form is that which is perhaps more regular for the regular writer user is the food notes but this also works that you have some low resolution image inside the document and if you click on that or tap on your device then some high resolution popup as a full screen object appears so this fixed layout is basically to you as a user it's quite the same as PDF just build on top of XHTML and SVG probably the primary use case is when you are working with a publisher that only accepts EPUB and you have some format like a comic book where the fixed layout is important because some reflowable text would modify the meaning of your content then fixed layout is still wanted and the publisher refuses to work with you if you provide a PDF of them this is something you can work with and the nice thing is that at the end it was not too complex to add support for this so even if you don't need it it's not a complexity that adds much overhead to the code so far this is what you get as a user and for the remaining time I will talk about how this is developed so the basic architecture is like this we have the writer document model and then the EPUB exporter works with that document document model and writes out an EPUB file inside the EPUB export I tried hard to re-invent anything so I tried to reuse what building blocks we already have the most interesting part is the EPUB generator library which is part of the document liberation project and it was not part of Libreface but now it's bundled with that and it was a good starting point I had to extend it variously but at least as an initial stop it was already working we start with invoking the ODT export and we consume the ODF XML markup this is nice because the EPUB-gen is working with the Librevenge API and that closely ties to the ODF format so this means that we don't have to do much transferring manually there is no explicit code to transfer the italic or boldness of characters this is just working out of the box we just transfer the character properties and so on so we have the ODF export, I explained Librevenge the Librevenge export that was the main part of the work to be able to use Librevenge based export filters inside Libreface but because the EPUB generator was the first one this building was necessary for the next Librevenge based export filter it will be much easier and at the very end Librebox just generates the various streams in this EPUB package but it has no support for compressing Z files and so on and that's great because we don't really want to have any front zip compression code so we get the callbacks and then the Libreface encode does the usual packaging just as it happens for OXML or ODF so this is a long list of features that I had to add to EPUB-gen and this means that by the time of the 6.0 release also a Libreepubgen release was made which is basically the file out of all the mentioned features then one concept I would like to explain is the media directory the media directory is the directory that sits next to the document that it contains files which are not part of the writer document model this means that it can contain an XMP file this metadata specification from Adobe to automatically override the metadata during export which is something you can specify manually on the user interface but this way you can convert thousands of documents automatically with some custom metadata override then I already mentioned this image pop-up use case where you have some multi megapixel photo and not only a small number of them but something large there are benefits of keeping that outside of the document model in writer also the core images are sitting here by default this is nothing complex if you have some foobar.odt then a directory next to the file called foobar is the default media directory and again you can customize this for the fixed layout initially I was a bit scared it sounded we will have to reinvent lots of features that the PDF export already has and why do this application there is little benefit to the end user and so on but eventually we already have the support for exporting writer pages to metafiles we already have an SVG export which can take a metafile which means that the fixed layout EPUB export result is really just a series of these SVG images and that be as the fixed layout EPUB document one problem with this was that the resulting document does not know much about characters and paragraphs anymore so how to provide some pretty navigation document or index for the file and for this I separated the responsible code for this from the PDF export which has a similar problem and now that building block can work without an actual PDF export but it can also work with an EPUB export and with that for each page we know which chapters are starting there I did not skip testing in real life but here I will skip testing and I just wanted to say that for everything we do at Collabora somebody has to pay for that because it's work and in this case Corey is sitting there known and office is small company and he and in collaboration with the partner was sponsoring this work so thanks a lot for them under the rise thanks for listening any questions great I use my time so thanks again for listening