This is the mail archive of the
docbook@lists.oasis-open.org
mailing list for the DocBook project.
[docbook] image-scaling (a never ending story?)
- From: Harald Finster <hfinster at gmx dot de>
- To: docbook at lists dot oasis-open dot org
- Date: Thu, 12 Feb 2004 10:12:25 +0100
- Subject: [docbook] image-scaling (a never ending story?)
Hallo,
after spending several frustrating days reading mailing-list
archives and using google, I dare to ask the following
(probably well known) question:
Ho do I scale images in docbook?
I have tried several variants like
<figure>
<title>Small</title>
<mediaobject>
<imageobject>
<imagedata fileref="small.png" format="PNG" scalefit="1" />
</imageobject>
</mediaobject>
</figure>
<imagedata fileref="small.png" format="PNG" width="5cm" scalefit="1" />
with and without format="PNG"
tried "depth" and "contentwidth" instead of "width"
all without any effect.
Images are always displayed in original size.
I am using 'db2pdf' coming with SuSE Linux, which is a script
based on jade.
The invocation of jade looks like this (db2tex):
jade -V tex-backend -t tex -c /usr/share/sgml/CATALOG.iso_ent -c /usr/share/sgml/CATALOG.jade_dsl -c /usr/share/sgml/CATALOG.docbook-dsssl-stylesheets -c /usr/share/sgml/CATALOG.db41xml -c
/usr/share/sgml/CATALOG.db42xml -D /usr/share/sgml/docbook/dsssl-stylesheets -d /usr/share/sgml/docbook/docbook-toys/suse-both.dsl#print -o test.tex /usr/share/sgml/jade_dsl/xml.dcl test.xml
TeX seems to be aware of the image size(s):
<small.png, id=38, 122.4575pt x 21.07875pt> <use small.png>
<big.png, id=39, 943.525pt x 160.6pt> <use big.png>
Overfull \hbox (540.2477pt too wide) detected at line 748
[]
I even tried to play with the resulting tex documents
{max-uniform}\def\ScaleType%
{1}\def\ScaleX%
{1}\def\ScaleY%
and used pdfjadetex to translate it into pdf with either
error messages or unscaled images.
Finally, I tries the xsl-path using:
xsltproc docbook-xsl-1.64.1/fo/docbook.xsl test.xml > test.fo
pdfxmltex simple.fo
creating just arrors:
pdfxmltex simple.fo
This is pdfTeX, Version 3.14159-1.00a-pretest-20011114-ojmw (Web2C 7.3.7)
(./simple.fo{/var/lib/texmf/pdftex/config/pdftex.cfg}
LaTeX2e <2001/06/01>
Babel <v3.7h> and hyphenation patterns for american, french, german, ngerman, n
ohyphenation, loaded.
xmltex version: 2002/06/25 v1.9 (Exp):
(/usr/share/texmf/tex/xmltex/xmltex.cfg)
No File: simple.cfg (/usr/share/texmf/tex/xmltex/passivetex/fotex.xmt)
(/usr/share/texmf/tex/latex/base/article.cls
Document Class: article 2001/04/21 v1.4e Standard LaTeX document class
(/usr/share/texmf/tex/latex/base/size10.clo))
(/usr/share/texmf/tex/xmltex/passivetex/fotex.sty
(/usr/share/texmf/tex/latex/graphics/graphicx.sty
...
(/usr/share/texmf/tex/latex/base/ts1cmr.fd)
(/usr/share/texmf/tex/latex/psnfss/t1ptm.fd) (./simple.out) (./simple.out)
! Interruption.
\XML@tempb ...#4\relax \relax ->\def #2{0.5in}#1#4
\relax \relax
l.2 ....5in" margin-left="1in" margin-right="1in">
<fo:region-body margin-bot...
?
So, I am a bit lost at the moment.
I would appreciate your help!
Greetings Harald
P.S.: sorry, if you get this twice. I sent this message yesterday
before having subscribed. As I could not find it in the latest
archive, I assume, it has been rejected by the list-server.
This is the complete document:
<?xml version="1.0" ?>
<!DOCTYPE book PUBLIC
"-//OASIS//DTD DocBook XML V4.2//EN"
"/usr/share/sgml/db42xml/docbookx.dtd">
<book id="test" lang="de">
<bookinfo>
<title>Test Graphics</title>
<releaseinfo>$Id: test.xml,v 1.2 2004/02/10 19:58:18 finster Exp finster $</releaseinfo>
</bookinfo>
<chapter id="ch-intro">
<title id="ch-title-intro">Introduction</title>
<para>A Small Figure (PNG)</para>
<figure>
<title>Small</title>
<mediaobject>
<imageobject>
<imagedata fileref="small.png" format="PNG" scalefit="1" />
</imageobject>
</mediaobject>
</figure>
<para>A Big Figure (PNG)</para>
<figure>
<title>Big</title>
<mediaobject>
<imageobject>
<imagedata fileref="big.png" format="PNG" width="5cm" scalefit="1" />
</imageobject>
</mediaobject>
</figure>
</chapter>
</book>
--
Dr.-Ing. Harald Finster / Aachen Germany
http://www.finster-stahlart.de industrial history and architecture
http://www.astrid-aix.de gallery: watercolours and oil paintings
To unsubscribe from this list, send a post to docbook-unsubscribe@lists.oasis-open.org, or visit http://www.oasis-open.org/mlmanage/.