DocBook <imagedata/> and scalefit attribute
Here should go questions about transforming XML with XSLT and FOP.
-
- Posts: 60
- Joined: Wed Jan 28, 2004 10:51 pm
DocBook <imagedata/> and scalefit attribute
Is there a [relatively] simple means of defining the viewport size of an <imagedata/> tag to the size of another element, possibly the enclosing element?
For example, in PDF output, I want the image scaled to fit the size of <figure/>, or, at the worst, <para/>. Anyway to handle this for the sample shown below?
-David
For example, in PDF output, I want the image scaled to fit the size of <figure/>, or, at the worst, <para/>. Anyway to handle this for the sample shown below?
Code: Select all
<para>Test
<figure>
<title>Static Web</title>
<mediaobject>
<imageobject role="html">
<imagedata fileref="diagrams/static.png"/>
</imageobject>
<imageobject role="fo">
<imagedata format="PDF" fileref="diagrams/static.pdf"/>
</imageobject>
</mediaobject>
</figure>
</para>
-
- Site Admin
- Posts: 2095
- Joined: Thu Jan 09, 2003 2:58 pm
Hi David,
I noticed you posted this on the xsl list, I think you have better chances to get a response on the docbook-apps list:
http://lists.oasis-open.org/archives/docbook-apps/
http://lists.oasis-open.org/
If someone here will know how to do what you asked we will surely post a reply.
Best Regards,
George
I noticed you posted this on the xsl list, I think you have better chances to get a response on the docbook-apps list:
http://lists.oasis-open.org/archives/docbook-apps/
http://lists.oasis-open.org/
If someone here will know how to do what you asked we will surely post a reply.
Best Regards,
George
-
- Posts: 60
- Joined: Wed Jan 28, 2004 10:51 pm
-
- Posts: 60
- Joined: Wed Jan 28, 2004 10:51 pm
This did work using the updated fo/graphics.xsl.Paul A. Hoadley wrote: I think what you want to do is described in Bob Stayton's book here:
http://www.sagehill.net/docbookxsl/ImageSizing.html
In particular:
To keep a graphic for printed output at its natural size unless it
is too large to fit the available width, in which case shrink it to
fit, use scalefit="1", width="100%", and contentdepth="100%"
attributes.
Eg.
Code: Select all
<para>
<figure>
<title>Static Web</title>
<mediaobject>
<imageobject role="html">
<imagedata fileref="diagrams/static.png"/>
</imageobject>
<imageobject role="fo">
<imagedata scalefit="1" width="100%" contentdepth="100%"
format="PDF" fileref="diagrams/static.pdf"/>
</imageobject>
</mediaobject>
</figure>
</para>
The odd thing is that the updated fo/graphics.xsl appears to require that img.src.path be defined. I simply set this to "'./'", but I wonder if this isn't a bug in the CVS stylesheet.Paul A. Hoadley wrote: DocBook XSL Stylesheets 1.68.1
You will need to replace fo/graphics.xsl with the current version from
CVS---this functionality only works post-1.68.1.
-David
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service