Ecrion Software Inc. Homepage
Forum Home Forum Home > XF Rendering Server > XSL-FO
  New Posts New Posts RSS Feed: Size of an image
  FAQ FAQ  Forum Search   Register Register  Login Login

Size of an image

 Post Reply Post Reply
Author
Message / View First Unread Post
falik View Drop Down
Newbie
Newbie


Joined: 13 Oct 2011
Posts: 10
Post Options Post Options   Quote falik Quote  Post ReplyReply Direct Link To This Post Topic: Size of an image
    Posted: 17 Nov 2011 at 11:29am
First, I'd like to thank u for all your previous help. I appreciate it.
I hope that I'm not too annoying on the forum, because as I see I'm actually the only one asking maybe newbie questions about xsl :)

My next problem is fitting an image to a page. I'm supposed to check the width of the image and compare it to the width of a page. Then, if the image is too wide I rotate it vertically and if not I do nothing. The problem is that I can't find a way of getting to the image size inside xsl. I was thinking of checking the size of created viewport but found nothing. 

Is any possibility to do this ?
Back to Top
radup View Drop Down
Admin Group
Admin Group
Avatar
Adminstrator

Joined: 19 May 2008
Posts: 83
Post Options Post Options   Quote radup Quote  Post ReplyReply Direct Link To This Post Posted: 18 Nov 2011 at 5:07am
I'm afraid is not possible, but we can implement it as custom development.
If you are interested please send us an email to support@ecrion.com.

Regards,
Radu


Edited by radup - 18 Nov 2011 at 5:07am
Back to Top
falik View Drop Down
Newbie
Newbie


Joined: 13 Oct 2011
Posts: 10
Post Options Post Options   Quote falik Quote  Post ReplyReply Direct Link To This Post Posted: 23 Nov 2011 at 7:31am
I'd rather do it my way. Do you think it's possible to implement such a function that get's the image size in javascript ?
Back to Top
admin View Drop Down
Admin Group
Admin Group


Joined: 19 May 2008
Posts: 68
Post Options Post Options   Quote admin Quote  Post ReplyReply Direct Link To This Post Posted: 23 Nov 2011 at 7:43am
Unfortunately XSL-FO doesn't "know" javascript.
If both the size of the image and the size of the page are known in advance, before the rendering, you can generate the XSL-FO accordingly and then send it to the engine.
To get the image size you will have to use a .NET or Java programming API.
Back to Top
falik View Drop Down
Newbie
Newbie


Joined: 13 Oct 2011
Posts: 10
Post Options Post Options   Quote falik Quote  Post ReplyReply Direct Link To This Post Posted: 23 Nov 2011 at 8:37am
But the XSL processor that your XF uses can interpret javascript can't he ?
I know that when using MSXSL I can use javascript. 
I thought of using some javascript with xml dom functions to do what I want. But I still can't find a solution. Maybe it's impossible ?
Back to Top
radup View Drop Down
Admin Group
Admin Group
Avatar
Adminstrator

Joined: 19 May 2008
Posts: 83
Post Options Post Options   Quote radup Quote  Post ReplyReply Direct Link To This Post Posted: 23 Nov 2011 at 9:58am
Yes, MSXSL knows javascript. But I don't think if you can get the image size with javascript.
Instead of using javascript you can try to use C# code with .NET XSLT engine. 



Edited by radup - 23 Nov 2011 at 10:17am
Back to Top
falik View Drop Down
Newbie
Newbie


Joined: 13 Oct 2011
Posts: 10
Post Options Post Options   Quote falik Quote  Post ReplyReply Direct Link To This Post Posted: 23 Nov 2011 at 10:25am
Yeah, I thought of using other languages but I'm supposed to make not many problems with that and using C# for an instance is quite problematic. 

It would be a lot easier if I could do the transformation that I want inside my formatter, not using external app's that I can create using .NET and C#, because If I understood u correctly u mean smth like this.

Just to end the topic, correct me if I'm wrong, it's not possible to get the size of an image just using xsl or MSXSL <script> with JScript ?
The only thing that would do the job is that custom development added to your Formatter yes ?

PS: about the javascript and image size, I was fooled a little with javascript Image element, as it is only a HTML DOM refference so not available in my xsl's 
Back to Top
radup View Drop Down
Admin Group
Admin Group
Avatar
Adminstrator

Joined: 19 May 2008
Posts: 83
Post Options Post Options   Quote radup Quote  Post ReplyReply Direct Link To This Post Posted: 23 Nov 2011 at 10:53am
What I meant is you can use C# code just like JSCript with our formatter. You just need to change the MSXSL XSLT engine use to .Net XSLT engine. See  "XSL Transformations" section in XF Designer http://www.ecrion.com/Temp/HelpCache/XFDesigner/framed_hidd_optionsdlg.htm 
Back to Top
falik View Drop Down
Newbie
Newbie


Joined: 13 Oct 2011
Posts: 10
Post Options Post Options   Quote falik Quote  Post ReplyReply Direct Link To This Post Posted: 23 Nov 2011 at 10:59am
Ok thanks, that's all I needed to know.

Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Bulletin Board Software by Web Wiz Forums® version 9.69
Copyright ©2001-2010 Web Wiz

This page was generated in 0.078 seconds.