Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
| Search | Today's Posts | Mark Forums Read
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old October 16th, 2008, 02:38 AM
Registered User
 
Join Date: Sep 2008
Location: Delhi, Delhi, India.
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default external-graphic scaling issue

Hi all,

I am writing down a piece of XSL code that I am using to display image.

<------------------------

<fo:block text-align="start" border="solid" height="34mm" width="210mm">
<fo:external-graphic src="url(img/pdflogo1.png)" display-align="before" scaling="uniform" content-height="100%" content-width="100%" />
</fo:block>

------------------------>
The block element that is containing the external-graphic has height = 34m. I want that graphic height should be 34mm but when I generate PDF from this XSL, it is always less than that. There is white space at the begining and end of block. I have tried following also :-

* content-height="34mm"
* content-height="scale-to-fit"

But nothing works. How can graphic height be of desired dimensions?

Atul


shinyboy
  #2 (permalink)  
Old October 16th, 2008, 03:33 AM
mhkay's Avatar
Wrox Author
Points: 18,487, Level: 59
Points: 18,487, Level: 59 Points: 18,487, Level: 59 Points: 18,487, Level: 59
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2004
Location: Reading, Berks, United Kingdom.
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

I'm not sure whether we have any xsl-fo experts monitoring this forum. You might be better off asking on the xsl-list at mulberrytech.com, or on the support list for your particular XSL-FO processor.

Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer's Reference
  #3 (permalink)  
Old October 16th, 2008, 03:38 AM
Friend of Wrox
Points: 1,306, Level: 14
Points: 1,306, Level: 14 Points: 1,306, Level: 14 Points: 1,306, Level: 14
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2008
Location: Pondicherry, India
Posts: 291
Thanks: 9
Thanked 29 Times in 29 Posts
Default

I'm not good in XSL FO. But, I could suggest you to use height attribute inside <fo:external-graphic> element, and check the output. Try with cm as unit.

Rummy
  #4 (permalink)  
Old October 21st, 2008, 12:20 AM
Registered User
 
Join Date: Sep 2008
Location: Delhi, Delhi, India.
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I got the solution, the block containing the external-graphic has line-height of 120% by default. So if you specify it to 100% then the space before image will disappear.

Also use these properties
* alignment-adjust="before-edge"
* alignment-baseline="before-edge"

So finally "external-graphic" will look like this :-

<fo:external-graphic src="url(img/head.jpg)" height="34mm" width="210mm" alignment-adjust="before-edge" alignment-baseline="before-edge" baseline-shift="super"/>

Hope this helps anybody else.

Atul

shinyboy


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sprite Scaling cgibson BOOK: Professional XNA Game Programming: For Xbox 360 and Windows ISBN: 978-0-470-12677-6 0 August 4th, 2007 06:58 PM
Scaling of decimal value resulted in data truncati rupen Access 6 June 2nd, 2007 08:31 AM
<fo:external-graphic> not displaying image devauk XSLT 0 July 18th, 2006 11:40 AM
OWC10 Scaling Object rfrancisco Classic ASP Components 0 March 13th, 2006 02:44 PM
Graphic Validation chemi J2EE 0 January 3rd, 2006 01:00 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.