Re: Transforming Img tag in HTML

2006-05-25 Thread Suresh Koya
I changed it as below. It finished the conversion pretty fast and did not create a PDF file. when I checked the output in debug mode I saw a classcast exception as below. Am I doing something wrong here.Regards,Suresh--- fo:block-container height="82px" width="294px"fo:blockfo:basic-link color="blue" external-destination="http://www.onjava.com/"  fo:external-graphic content-height="82px" content-width="294px" height="82px" width="294px" src=""
 scaling="uniform"//fo:basic-link/fo:block/fo:block-containerException trace:org.apache.fop.apps.FOPException: org.apache.fop.layout.BlockArea at org.apache.fop.apps.CommandLineStarter.run(CommandLineStarter.java:111) at org.apache.fop.apps.Fop.main(Fop.java:62)-java.lang.ClassCastException: org.apache.fop.layout.BlockArea at org.apache.fop.fo.flow.BlockContainer.layout(BlockContainer.java:157) at org.apache.fop.fo.flow.Block.layout(Block.java:257) at
 org.apache.fop.fo.flow.AbstractFlow.layout(AbstractFlow.java:154) at org.apache.fop.fo.flow.AbstractFlow.layout(AbstractFlow.java:110) at org.apache.fop.fo.pagination.PageSequence.makePage(PageSequence.java:400) at org.apache.fop.fo.pagination.PageSequence.format(PageSequence.java:338) at org.apache.fop.apps.StreamRenderer.render(StreamRenderer.java:262) at org.apache.fop.fo.FOTreeBuilder.endElement(FOTreeBuilder.java:223) at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source) at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source) at
 org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source) at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source) at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) at org.apache.fop.apps.Driver.render(Driver.java:498) at org.apache.fop.apps.CommandLineStarter.run(CommandLineStarter.java:106) at
 org.apache.fop.apps.Fop.main(Fop.java:62)-java.lang.ClassCastException: org.apache.fop.layout.BlockArea at org.apache.fop.fo.flow.BlockContainer.layout(BlockContainer.java:157) at org.apache.fop.fo.flow.Block.layout(Block.java:257) at org.apache.fop.fo.flow.AbstractFlow.layout(AbstractFlow.java:154) at org.apache.fop.fo.flow.AbstractFlow.layout(AbstractFlow.java:110) at org.apache.fop.fo.pagination.PageSequence.makePage(PageSequence.java:400) at org.apache.fop.fo.pagination.PageSequence.format(PageSequence.java:338) at
 org.apache.fop.apps.StreamRenderer.render(StreamRenderer.java:262) at org.apache.fop.fo.FOTreeBuilder.endElement(FOTreeBuilder.java:223) at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source) at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source) at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown
 Source) at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) at org.apache.fop.apps.Driver.render(Driver.java:498) at org.apache.fop.apps.CommandLineStarter.run(CommandLineStarter.java:106) at org.apache.fop.apps.Fop.main(Fop.java:62)Roland Neilands [EMAIL PROTECTED] wrote: Suresh,Sorry, my mistake. 20.5 wants height/width on the block container.This works in both versions:  content-width="3cm" src="" scaling="uniform"/Regards,RolandSuresh Koya wrote: I checked this with the beta build also. I could not get it to work.  Should I file a bug to this respect. Regards, Suresh Koya */Roland Neilands <[EMAIL PROTECTED]>/* wrote: Suresh, What you've done is correct, but not supported by the old version of FOP - try the beta release, or use height  width attributes as well. Search this list's archives for more details, this has come up a few times. Regards, Roland Suresh Koya wrote:  Hi,   I am using FOP 0.20.5. I was trying to transform the IMG tag of HTML:   
 height="82"/   After going through the XSL_FO Spec, I created a FO document  equivalent to this for generating a PDF as belows:src=""/   The generated PDF had the image bigger than the original size (294 X 82).  Is could not find an example for this in the samples as well.   Could anyone suggest what is the right way to set the width and height  a image. 

Re: Transforming Img tag in HTML

2006-05-25 Thread Chris Bowditch

Suresh Koya wrote:

I changed it as below. It finished the conversion pretty fast and did 
not create a PDF file. when I checked the output in debug mode I saw a 
classcast exception as below. Am I doing something wrong here.


FOP 0.20.5 only supports absolutely positioned block-containers, that is 
why you get a ClassCstException as you are trying to use it in a 
relatively positioned manner. I don't think block-containers will help 
you achieve what you want.


The problem is the unit of measurement you have specified for the image 
width and height. Trouble with pixels is they are device dependent. FOP 
defaults to 72dpi, and I guess HTML is 96dpi which is why the image 
appears 33% larger in FOP. If you specify a unit of measurement which 
isn't device dependent, e.g. inches, cm, mm, or pt then FOP should 
display your image fine.


In your case I would recommend dividing by the HTML resolution (i.e. 
96dpi) to give you a unit in inches in the XSLT to compute the height 
and width for fo:external-graphic tag.


Chris



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Transforming Img tag in HTML

2006-05-25 Thread J.Pietschmann

Roland Neilands wrote:

Sorry, my mistake. 20.5 wants height/width on the block container.

...
   fo:external-graphic content-height=3cm content-width=3cm 


FOP 0.20.5 doesn't support content-heigth/width either. Height
and width work.

J.Pietschmann


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Transforming Img tag in HTML

2006-05-25 Thread Roland Neilands


J.Pietschmann wrote:

Roland Neilands wrote:

Sorry, my mistake. 20.5 wants height/width on the block container.

...
   fo:external-graphic content-height=3cm content-width=3cm 


FOP 0.20.5 doesn't support content-heigth/width either. Height
and width work.


I know, it ignores them though. That's why that bit of code worked in 
both versions of FOP.


Cheers,
Roland.



J.Pietschmann



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Transforming Img tag in HTML

2006-05-25 Thread Roland Neilands

Roland Neilands wrote:


J.Pietschmann wrote:

Roland Neilands wrote:

Sorry, my mistake. 20.5 wants height/width on the block container.

...
   fo:external-graphic content-height=3cm 
content-width=3cm 


FOP 0.20.5 doesn't support content-heigth/width either. Height
and width work.


I know, it ignores them though. That's why that bit of code worked in 
both versions of FOP.
Except where I'd trimmed the absolute positioning from the block 
container. I'll shut up now.


Cheers,
Roland.



J.Pietschmann





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Transforming Img tag in HTML

2006-05-24 Thread Suresh Koya
Hi,I am using FOP 0.20.5. I was trying to transform the IMG tag of HTML: img src="http://onjava.com/images/onjava/onjava_logo.jpg" width="294" height="82"/After going through the XSL_FO Spec, I created a FO document equivalent to this for generating a PDF as belows:fo:external-graphic content-height="82px" content-width="294px" src=""attribute-value">http://onjava.com/images/onjava/onjava_logo.jpg"/The generated PDF had the image bigger than the
 original size (294 X 82).Is could not  find an example for this in the samples as well.Could anyone suggest what is the right way to set the width and height a image.Regards,Suresh 
		Blab-away for as little as 1¢/min. Make  PC-to-Phone Calls using Yahoo! Messenger with Voice.

Re: Transforming Img tag in HTML

2006-05-24 Thread Roland Neilands

Suresh,

What you've done is correct, but not supported by the old version of FOP 
- try the beta release, or use height  width attributes as well. Search 
this list's archives for more details, this has come up a few times.


Regards,
Roland


Suresh Koya wrote:

Hi,

I am using FOP 0.20.5. I was trying to transform the IMG tag of HTML:

img src=http://onjava.com/images/onjava/onjava_logo.jpg; width=294 
height=82/


After going through the XSL_FO Spec, I created a FO document 
equivalent to this for generating a PDF as belows:


fo:external-graphic content-height=82px content-width=294px
 src=http://onjava.com/images/onjava/onjava_logo.jpg/

The generated PDF had the image bigger than the original size (294 X 82).
Is could not find an example for this in the samples as well.

Could anyone suggest what is the right way to set the width and height 
a image.


Regards,
Suresh
 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Transforming Img tag in HTML

2006-05-24 Thread Suresh Koya
I checked this with the beta build also. I could not get it to work. Should I file a bug to this respect.Regards,Suresh KoyaRoland Neilands [EMAIL PROTECTED] wrote: Suresh,What you've done is correct, but not supported by the old version of FOP - try the beta release, or use height  width attributes as well. Search this list's archives for more details, this has come up a few times.Regards,RolandSuresh Koya wrote: Hi, I am using FOP 0.20.5. I was trying to transform the IMG tag of HTML:  height="82"/ After going through the XSL_FO Spec, I created a FO document  equivalent to this for generating a PDF as
 belows:   src=""/ The generated PDF had the image bigger than the original size (294 X 82). Is could not find an example for this in the samples as well. Could anyone suggest what is the right way to set the width and height  a image. Regards, Suresh  -To unsubscribe, e-mail: [EMAIL PROTECTED]For additional commands, e-mail: [EMAIL PROTECTED]
		Ring'em or ping'em. Make  PC-to-phone calls as low as 1¢/min with Yahoo! Messenger with Voice.

Re: Transforming Img tag in HTML

2006-05-24 Thread Roland Neilands

Suresh,

Sorry, my mistake. 20.5 wants height/width on the block container.

This works in both versions:
   fo:block-container height=3cm width=3cm
 fo:block
   fo:external-graphic content-height=3cm 
content-width=3cm src=file.jpg scaling=uniform/


Regards,
Roland



Suresh Koya wrote:
I checked this with the beta build also. I could not get it to work. 
Should I file a bug to this respect.


Regards,
Suresh Koya

*/Roland Neilands [EMAIL PROTECTED]/* wrote:

Suresh,

What you've done is correct, but not supported by the old version
of FOP
- try the beta release, or use height  width attributes as well.
Search
this list's archives for more details, this has come up a few times.

Regards,
Roland


Suresh Koya wrote:
 Hi,

 I am using FOP 0.20.5. I was trying to transform the IMG tag of
HTML:


 height=82/

 After going through the XSL_FO Spec, I created a FO document
 equivalent to this for generating a PDF as belows:


 src=http://onjava.com/images/onjava/onjava_logo.jpg/

 The generated PDF had the image bigger than the original size
(294 X 82).
 Is could not find an example for this in the samples as well.

 Could anyone suggest what is the right way to set the width and
height
 a image.

 Regards,
 Suresh


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Ring'em or ping'em. Make PC-to-phone calls as low as 1¢/min 
http://us.rd.yahoo.com/mail_us/taglines/postman11/*http://us.rd.yahoo.com/evt=39666/*http://voice.yahoo.com 
with Yahoo! Messenger with Voice. 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]