You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@uima.apache.org by Thilo Goetz <tw...@gmx.de> on 2007/05/31 18:00:58 UTC

Images in documentation

Everybody,

I'm in the process of updating the CVD docs, and struggling with 
the images again.  Since I've found no way to make things work for
both pdf and html, I've decided to go with html.  I'm leaving the
images unscaled, which looks good in the browser.  In pdf, they
come out way too big, but that's better than too small and
unreadable.  I assume that there is still no way to make this work
for pdf *and* html.  Marshall?

--Thilo

Re: Images in documentation

Posted by Thilo Goetz <tw...@gmx.de>.
Marshall Schor wrote:
> I don't really know the answers to your questions, other than to say 
> these are known issues, with some workarounds.
> One source of some limited enlightenment was here:
> 
> http://www.sagehill.net/docbookxsl/ImageSizing.html
> 
> It says things like:
>    Image sizing can be somewhat complex because there are many
>    |imagedata| attributes that affect it.
> 
>    The definitive description of how these attributes are supposed to
>    affect the output appears in the reference page for imagedata in
>    /DocBook: The Definitive Guide/
>    <http://docbook.org/tdg/en/html/imagedata.html>. In practice, some
>    of the attributes are not fully supported by some processors.
> 
>    Some XSL-FO processors don't support all of these attributes. You
>    may need to experiment to see what works. For example, FOP version
>    0.20.5 treats |width| as if it were |contentwidth| and ignores any
>    real |contentwidth| attribute
> 
> -Marshall
> 

Thanks Marshall.  I've read the docbook documentation, and it's reasonably
clear.  It just seems that the tools we're using don't behave the way
they're supposed to.  So I'll stick with making it look good in html, as
that's what most people will use, I think.  The pdf can limp along as
best as it can ;-)

--Thilo


Re: Images in documentation

Posted by Marshall Schor <ms...@schor.com>.
I don't really know the answers to your questions, other than to say 
these are known issues, with some workarounds.
One source of some limited enlightenment was here:

http://www.sagehill.net/docbookxsl/ImageSizing.html

It says things like: 

    Image sizing can be somewhat complex because there are many
    |imagedata| attributes that affect it.

    The definitive description of how these attributes are supposed to
    affect the output appears in the reference page for imagedata in
    /DocBook: The Definitive Guide/
    <http://docbook.org/tdg/en/html/imagedata.html>. In practice, some
    of the attributes are not fully supported by some processors.

    Some XSL-FO processors don't support all of these attributes. You
    may need to experiment to see what works. For example, FOP version
    0.20.5 treats |width| as if it were |contentwidth| and ignores any
    real |contentwidth| attribute

-Marshall


Thilo Goetz wrote:
> Marshall Schor wrote:
>> Thilo Goetz wrote:
>>> Everybody,
>>>
>>> I'm in the process of updating the CVD docs, and struggling with the 
>>> images again.  Since I've found no way to make things work for
>>> both pdf and html, I've decided to go with html.  I'm leaving the
>>> images unscaled, which looks good in the browser.  In pdf, they
>>> come out way too big, but that's better than too small and
>>> unreadable.  I assume that there is still no way to make this work
>>> for pdf *and* html.  Marshall?
>>>   
>>
>> This was resolved in the last big update to the docbook stuff.  
>> Here's how it's done:
>>
>> In your markup you says something like:
>>
>> <imagedata width="230px" format="JPG" 
>> fileref="&imgroot;basic_error_chain.jpg"/>
>>
>> The important part is to specify the width somehow.  This should be 
>> with width for pdf (one that makes it
>> look nice in pdf output).
>> The pdf transformation has this in it (see 
>> uima-docbook-tool/styles/uima-style/common/html-pdf.xsl):
>>
>> <!-- expand plain imageobject nodes into doubles, one for fo output 
>> the other for html output
>>       Scale the html output by 1.1 for inches or 1.4 for pixels -->
>>   What this does is replace your markup with a "double" markup, one 
>> conditioned on html output, the other on pdf
>> output, and changes the width param according to a scale factor which 
>> depends on whether you specify the
>> width in pixels or some absolute measurement like inches or cm.
>> If it's not working, let me know...
>>
>> -Marshall
>
> Can you explain this in terms somebody who hasn't the least clue about
> docbook and this whole setup can understand?  Why do I even have to 
> specify
> a width?  I don't want any scaling.  I want the images, at least in html,
> to be exactly like I provide them.  That will guarantee the best quality,
> at least in hmtl.  I'd even be happy to specify different thing for pdf
> and html, if I knew how.
>
> When I specify a scale of 100%, why do the images get enlarged in pdf?
>
> --Thilo
>
>


Re: Images in documentation

Posted by Thilo Goetz <tw...@gmx.de>.
Marshall Schor wrote:
> Thilo Goetz wrote:
>> Everybody,
>>
>> I'm in the process of updating the CVD docs, and struggling with the 
>> images again.  Since I've found no way to make things work for
>> both pdf and html, I've decided to go with html.  I'm leaving the
>> images unscaled, which looks good in the browser.  In pdf, they
>> come out way too big, but that's better than too small and
>> unreadable.  I assume that there is still no way to make this work
>> for pdf *and* html.  Marshall?
>>   
> 
> This was resolved in the last big update to the docbook stuff.  Here's 
> how it's done:
> 
> In your markup you says something like:
> 
> <imagedata width="230px" format="JPG" 
> fileref="&imgroot;basic_error_chain.jpg"/>
> 
> The important part is to specify the width somehow.  This should be with 
> width for pdf (one that makes it
> look nice in pdf output).
> The pdf transformation has this in it (see 
> uima-docbook-tool/styles/uima-style/common/html-pdf.xsl):
> 
> <!-- expand plain imageobject nodes into doubles, one for fo output the 
> other for html output
>       Scale the html output by 1.1 for inches or 1.4 for pixels -->
>   What this does is replace your markup with a "double" markup, one 
> conditioned on html output, the other on pdf
> output, and changes the width param according to a scale factor which 
> depends on whether you specify the
> width in pixels or some absolute measurement like inches or cm.
> If it's not working, let me know...
> 
> -Marshall

Can you explain this in terms somebody who hasn't the least clue about
docbook and this whole setup can understand?  Why do I even have to specify
a width?  I don't want any scaling.  I want the images, at least in html,
to be exactly like I provide them.  That will guarantee the best quality,
at least in hmtl.  I'd even be happy to specify different thing for pdf
and html, if I knew how.

When I specify a scale of 100%, why do the images get enlarged in pdf?

--Thilo

Re: Images in documentation

Posted by Marshall Schor <ms...@schor.com>.
Thilo Goetz wrote:
> Everybody,
>
> I'm in the process of updating the CVD docs, and struggling with 
> the images again.  Since I've found no way to make things work for
> both pdf and html, I've decided to go with html.  I'm leaving the
> images unscaled, which looks good in the browser.  In pdf, they
> come out way too big, but that's better than too small and
> unreadable.  I assume that there is still no way to make this work
> for pdf *and* html.  Marshall?
>   

This was resolved in the last big update to the docbook stuff.  Here's 
how it's done:

In your markup you says something like:

 <imagedata width="230px" format="JPG" 
fileref="&imgroot;basic_error_chain.jpg"/>

The important part is to specify the width somehow.  This should be with 
width for pdf (one that makes it
look nice in pdf output). 

The pdf transformation has this in it (see 
uima-docbook-tool/styles/uima-style/common/html-pdf.xsl):

<!-- expand plain imageobject nodes into doubles, one for fo output the 
other for html output
       Scale the html output by 1.1 for inches or 1.4 for pixels -->
   
What this does is replace your markup with a "double" markup, one 
conditioned on html output, the other on pdf
output, and changes the width param according to a scale factor which 
depends on whether you specify the
width in pixels or some absolute measurement like inches or cm. 

If it's not working, let me know...

-Marshall