View Full Version : ePub (and KF8) from SVGs


heinrich66
05-03-2012, 08:54 AM
Hello, sages of Mobileread!

I have (what may be) an oddball question.

I have a book of poems that I would like to end up in KF8 format, and perhaps transitionally in ePub.

Each page has a distinctive vector 'page frame' like an antique picture frame. Inside the frame is a short poem of only a few lines. The poem (in print) uses a distinctive font that goes with the surrounding frame.

My wacky idea is that I might be able to have (2) SVGs -- one for the left-hand and one for the right-hand page frame. (Though this might be reduced to one given the electronic format.)

Then separately, the text of each poem is saved as an SVG of under 10 KB. The code for each page would 'call' the SVG page frame and display the separate SVG poem within it.

Is this workable or unworkable? Simple or insane?

While I have done print books, I have no real experience doing eBooks yet. It would be nice if I could represent each page as a pair of vector graphics (inner and outer) to preserve the appearance of each page. As long as the final ePub or KF8 file size is under the limit (to avoid Amazon 'transmission' cost)...

Any help would be appreciated!

DaleDe
05-03-2012, 12:45 PM
It is possible to reference an SVG element as an img or object from a XHTML page thus you can reuse the same SVG over and over. I am not aware of a way to embed the text you want inside the image directly. However you could have a top and a bottom SVG image and the text between them. I take it that you want one element per page so you will need to scale the image to make this happen with various size (resolution pages). I think you will have to experiment a bit, and read the document http://www.w3.org/TR/SVG11/Overview.html

Dale

heinrich66
05-03-2012, 01:13 PM
It is possible to reference an SVG element as an img or object from a XHTML page thus you can reuse the same SVG over and over. I am not aware of a way to embed the text you want inside the image directly. However you could have a top and a bottom SVG image and the text between them. I take it that you want one element per page so you will need to scale the image to make this happen with various size (resolution pages). I think you will have to experiment a bit, and read the document http://www.w3.org/TR/SVG11/Overview.html

Dale

Thanks for your reply.

My thought was to have 2 SVGs -- one inside the other. Rather than use plain text, I would make a separate SVG of the poem text. The net effect is the page frame going around the 'outside' while the poem text is itself an SVG on the 'inside'. Thus there would be 2 SVGs per page -- one page frame vector which is on every page, one poem-text SVG which is unique for each page.

Jellby
05-03-2012, 01:23 PM
I guess you can have an SVG file that calls/includes another SVG file. Would that work for you?

heinrich66
05-03-2012, 01:25 PM
I guess you can have an SVG file that calls/includes another SVG file. Would that work for you?

That's what I was hoping: any obvious problems/major difficulties with that approach?

DaleDe
05-03-2012, 01:56 PM
Thanks for your reply.

My thought was to have 2 SVGs -- one inside the other. Rather than use plain text, I would make a separate SVG of the poem text. The net effect is the page frame going around the 'outside' while the poem text is itself an SVG on the 'inside'. Thus there would be 2 SVGs per page -- one page frame vector which is on every page, one poem-text SVG which is unique for each page.

I am not sure this will work as you expect. I was thinking of there SVG in a flat arrangement. The top one would be referenced off page as a header, the second one with the text referenced on page and the third one reference off page as a footer. The onpage reference would contain the text and also connecting lines to the other two images.

I believe you should just experiment with this approach. I don't think anyone here can give you a step by step solution. You are just going to have to try an approach and then test it with various reading devices to see what works. It would actually be pretty easy to develop a test case using simple SVG graphics like a curved line at the top and bottom and connecting lines in the middle. I don't know how you will call another SVG in a separate file from within an SVG and have it work properly.

Please experiment and report back on what you find. You could use Sigil to develop the test case and then experiment with it.

Dale