xmlgraphics-fop-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eldho George <geor...@ocwen.co.in>
Subject RE: how can I create template for manipulating embedded and exter nal style sheet present in the html page? Is it possible?
Date Tue, 07 Sep 2004 06:01:22 GMT
Hi mike

Thank you for your reply. Thank you..........

Actually my problem is i want to convert a web page into PDF. What is my
logic is i created one servlet.In that servlet
i am reading the content of url(html content).I apply W3C tidy to make it as
xhtml.I created an xsl file using xslt and xsl-fo.
I created template for all the html 4.0 tags and its working properly.(Some
problem with table).Then applying xhtml and xsl to 
XSLTInputHandler of fop and render it to PDF.

My problem is with table only

<table width="">.I created template for width attribute.

<xsl:attribute-set name="table-structure">
	<xsl:attribute name="table-layout">auto</xsl:attribute>
	<xsl:attribute name="space-before">10pt</xsl:attribute>
	<xsl:attribute name="space-after">10pt</xsl:attribute>
</xsl:attribute-set>


<fo:table xsl:use-attribute-sets="table-structure">
	<xsl:when test="@width">
		<xsl:attribute name="width">
			<xsl:call-template name="createwidth"/>
		</xsl:attribute>
	</xsl:when>
</fo:table>

But all the time the table will be displayed on the entire page width.
suppose we are creating a table with 2 column.
In html this will be displayed as a small table (depending upon the table
content).But my problem is in PDF it will be displayed 
in entire page width. How can i solve this problem..............Please help
me.............

Following is the overview of my table layout

<xsl:attribute-set name="table-structure">
	<xsl:attribute name="table-layout">auto</xsl:attribute>
	<xsl:attribute name="space-before">10pt</xsl:attribute>
	<xsl:attribute name="space-after">10pt</xsl:attribute>
	<xsl:attribute name="border-style">outset</xsl:attribute>
	<xsl:attribute name="border-collapse">separate</xsl:attribute>
	<xsl:attribute name="border-spacing">2px</xsl:attribute>
</xsl:attribute-set>

<fo:table xsl:use-attribute-sets="table-structure">

<xsl:for-each
select="tr[1]/th|tr[1]/td|thead/tr[1]/th|thead/tr[1]/td|tbody/tr[1]/th|tbody
/tr[1]/td">
			<fo:table-column
column-width="proportional-column-width(1)"/>
</xsl:for-each>

<!--==========handle <tbody> element =========-->
<!--==========handle <thead> element =========-->
<!--==========handle <tfoot> element =========-->

</fo:table>

Thanks in advance
Cheers
george





-----Original Message-----
From: Mike Trotman [mailto:mike.trotman@blueyonder.co.uk] 
Sent: Monday, September 06, 2004 9:21 PM
To: fop-user@xml.apache.org
Subject: Re: how can I create template for manipulating embedded and
external style sheet present in the html page? Is it possible?



**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

www.mimesweeper.com
**********************************************************************


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
 
A quick response as I'm not sure I understand your question - but I
think you're saying you can process all the 'inline' style + other
attributes in an HTML document - but that you want ot be able to
implement CSS class styles in FO->PDF?

If so - that is not easy - particularly as CSS <-> XSL-FO attributes
don't always map straightforwardly and some have different names,
and detecting precedence, context and dealing with multiple CSS
stylesheets is difficult.

A useful utility from RenderX  which may help you to map equivalent
attributes is at http://www.renderx.com/~renderx/portal/fo2html.html.
This maps XSLFO -> HTML - and does a pretty good job.

The way I deal with this problem is to turn the CSS stylesheets into XML
documents - and then add attributes for the XSLFO equivalents.
The structure of this XML depends on how much of the complexity of CSS
you want to capture.)
(this document can the be used to produce the CSS stylesheets as well.)
I then load this document as a parameter when processing and lookup any
formatting for the element / class I am dealing with.
(I find this easier than trying to define fixed attribute sets.)

With XSL / XML based output formatting it is nearly always easier to
have a core XML document from which all other output (including HTML) is
generated.
If your HTML is well formed XML /  XHTML then your task is easier.

FOP 0.20.5 does not suppor table-with-caption - and many other
processors also do not.
FOP 0.20.5 does not support table-layout='auto' (only 'fixed') - and
this is also true of many other processors - so I don't know how you are
getting the table to fit the width of the page.
unless you are specifying that the inline-progression dimension='100%'.

Eldho George wrote:

|  
|
| Hi,
|
|  
|
|  
|
| I would like to know *how can I create template for manipulating
| embedded and external style sheet present in the html page? Is it
| possible?*
|
|  
|
| *Please help me................please tell me is it possible with
| xslt+xsl-fo? I already created template for processing inline style
| attribute.*
|
|  
|
|  
|
| I am working with the project of converting a web Page into PDF.I am
| using FOP.I am creating the formatting object tree using xslt.I
| already create template for most of the html 4.0 tags and everything
| this working perfectly.But I have problem with table .It showing the
| table with entire page width. That means suppose I have created only
| one column, it will occupy the entire page width. Suppose I am using
| width in table, it is not shrinking according to that width. I used
| table attribute as
|
|  
|
|  
|
|  
|
| <xsl:attribute name="table-layout">auto</xsl:attribute>
|
| <xsl:attribute name="space-before">10pt</xsl:attribute>
|
| <xsl:attribute name="space-after">10pt</xsl:attribute>
|
| <xsl:attribute name="border-style">outset</xsl:attribute>
|
| <xsl:attribute name="border-collapse">separate</xsl:attribute>
|
| <xsl:attribute name="border-spacing">2px</xsl:attribute>
|
|  
|
|  
|
| Another problem is - outset is not working.<fo:table-and-caption> is
| not working with fop.So I am not use <fo:table-and-caption>.This will
| create any problem?
|
| I would like to know whether fop will support
| <fo:table-and-caption>????????
|
|  
|
| I would like to know *how can I create template for manipulating
| embedded and external style sheet present in the html page? Is it
| possible?*
|
|  
|
| *Please help me................please tell me is it possible with
| xslt? I already created template for processing inline style attribute.*
|
|  
|
| Thanks in advance
|
| George
|
|  
|
|  
|
|  
|
| |
|
| **********************************************************************
| This email and any files transmitted with it are confidential and
| intended solely for the use of the individual or entity to whom they
| are addressed. If you have received this email in error please notify
| the system manager.
|
| This footnote also confirms that this email message has been swept by
| MIMEsweeper for the presence of computer viruses.
|
| www.mimesweeper.com
| **********************************************************************
| |


- --
Datalucid Limited
8 Eileen Road
South Norwood
London SE25 5EJ
United Kingdom

/
tel :0208-239-6810
mob: 0794-725-9760
email: mike.trotman@datalucid.com

UK Co. Reg:   4383635
VAT Reg.:   798 7531 60

/

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (MingW32)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
 
iD8DBQFBPIdPe72ghYHWur4RAgrhAJ41r8srH60skFbrzntb4hDUaneQsACdGERP
/AscqsnlmD5I6NbUhaJYKdI=
=hmNf
-----END PGP SIGNATURE-----



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org


**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

www.mimesweeper.com
**********************************************************************


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org


Mime
View raw message