![]() |
Size of an image |
Post Reply
|
| Author | |
falik
Newbie
Joined: 13 Oct 2011 Posts: 10 |
Post Options
Quote Reply
Topic: Size of an imagePosted: 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 ?
|
|
![]() |
|
radup
Admin Group
Adminstrator Joined: 19 May 2008 Posts: 83 |
Post Options
Quote Reply
Posted: 18 Nov 2011 at 5:07am |
|
Edited by radup - 18 Nov 2011 at 5:07am |
|
![]() |
|
falik
Newbie
Joined: 13 Oct 2011 Posts: 10 |
Post Options
Quote Reply
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 ?
|
|
![]() |
|
admin
Admin Group
Joined: 19 May 2008 Posts: 68 |
Post Options
Quote Reply
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.
|
|
![]() |
|
falik
Newbie
Joined: 13 Oct 2011 Posts: 10 |
Post Options
Quote Reply
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 ?
|
|
![]() |
|
radup
Admin Group
Adminstrator Joined: 19 May 2008 Posts: 83 |
Post Options
Quote Reply
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 |
|
![]() |
|
falik
Newbie
Joined: 13 Oct 2011 Posts: 10 |
Post Options
Quote Reply
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
|
|
![]() |
|
radup
Admin Group
Adminstrator Joined: 19 May 2008 Posts: 83 |
Post Options
Quote Reply
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
|
|
![]() |
|
falik
Newbie
Joined: 13 Oct 2011 Posts: 10 |
Post Options
Quote Reply
Posted: 23 Nov 2011 at 10:59am |
|
Ok thanks, that's all I needed to know.
|
|
![]() |
|
Post Reply
|
| Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |