Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > XML > XSLT
Password Reminder
Register
| FAQ | Members List | Calendar | 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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #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
Reply With Quote
  #2 (permalink)  
Old October 16th, 2008, 03:33 AM
mhkay's Avatar
Wrox Author
Points: 18,481, Level: 59
Points: 18,481, Level: 59 Points: 18,481, Level: 59 Points: 18,481, Level: 59
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Apr 2004
Location: Reading, Berks, United Kingdom.
Posts: 4,960
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
Reply With Quote
  #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
Reply With Quote
  #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
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 06:03 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.