On 20 September 2011 20:22, Ivan Voras <[email protected]> wrote:
> On Sep 20, 12:12 am, Lex Trotman <[email protected]> wrote:
>> On 20 September 2011 04:23, Ivan Voras <[email protected]> wrote:
>>
>> > I'm trying to write a manual and I'd like it to end up in both HTML
>> > and PDF. The problem is that bitmap graphics look awful when included
>> > in PDF so I'd like to use a vector format. I tried using SVG but
>> > neither the current web browsers nor the PDF toolchain support it -
>> > which is very unfortunate.
>>
>> > Any suggestions on how to use vector graphics? Since browsers don't
>> > support anything else, this would probably mean that two formats are
>> > specified - PNG and something else for the same image - is this even
>> > possible?
>>
>> Hi Ivan,
>>
>> Pretty much all browsers support svg.
>
> Nope. I can send you the document so you can see for yourself. By
> "support" I mean used as "<img src=xxx.svg>".
Well no wonder you can't get it to work in any browser, thats not
valid HTML, SVG isn't an image and can't be used with the img tag.
The example below shows the correct <object etc html, which works in
the few browsers I have access to and is reported to work in most
modern browsers.
>
>> You can include SVG in HTML using passthrough, eg
>>
>> +++<object data="drawing.svg" type="image/svg+xml"></object>+++
>
> If I must do it that way, I'd rather not use asciidoc at all :)
As I said below you can hide the nasties by writing your own macro :)
>
>> The FOP pdf toolchain supports svg.
>
> ... but the "normal" PDF processor (whatever it is) produces much
> better looking documents for me.
>
The default is dblatex which doesn't support SVG at all.
>> You can use conditional macros to decide which to include in the
>> output. If you are doing it a lot then it is probably best to define
>> yourself a macro for it.
>
> This would be the approach with both a bitmap image and a vector image
> and switching between them? So far, I'm using the "image::" macro and
> it produces nice looking image captions - could I retain that?
Just include the following stolen from the image macro definition
</div>
<div class="title">{caption={figure-caption} {counter:figure-number}.
}{title}</div>
</div>
in your svg:: macro when you create it.
In fact its worthwhile looking at how images are created in the
docbook and xhtml backends and re-use as many ideas as are
appropriate.
Cheers
Lex
--
You received this message because you are subscribed to the Google Groups
"asciidoc" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/asciidoc?hl=en.