This should put a rectangle with a black border at the given position on the page. However, on my output page the styling attributes aren't applied and consequently nothing appears.
On the other hand, when I set the attributes directly on the fo:block-container element like so :
With regards to the PDF Creator, am I missing something obvious or are XSL attribute sets not supported? I would be most grateful if someone could knock up a simple working example to get me going.
Kind regards,
Scott
P.S. my code is in a Razor macro directly within an Umbraco document template, not in an XSLT macro, if that makes any difference.
As far as I can see, the example about does not work with the xsl-fo used by the PDF creator?
I can't even get the table to display when I insert it into my code, ignoring the styling issue. I am currently outputting the page content using FO-BLOCK and FO_INLINE.
From the top of the file:
<?xml version="1.0" encoding="UTF-8" ?>
@inherits Umbraco.Web.Mvc.UmbracoTemplatePage
@using FergusonMoriyama.Pdf
@using System.Xml
@using umbraco.IO
@
Layout = null;
Response.ContentType = "text/xsl";
Response.AppendHeader("X-Pdf-Render","true"); //-- Comment out to show generated XML</p>
// -- Uncomment this to force the browser to download the PDF.
// Response.AppendHeader("X-Pdf-Force-Download","darren.pdf");
}
<xsl:stylesheet xmlns:fo="http://www.w3.org/1999/XSL/Format" version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
@* This assigns attributes to attribute-set(s) [classes] *@
<xsl:attribute-set name="kate-test">
<xsl:attribute name="fname">Arial</xsl:attribute>
<xsl:attribute name="size">64px</xsl:attribute>
<xsl:attribute name="color">red</xsl:attribute>
</xsl:attribute-set>
<xsl:template match="/">
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:ibex="http://www.xmlpdf.com/2003/ibex/Format" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
@* Sets standard PDF Metadata *@
<ibex:properties
title="@CurrentPage.Name"
author="@CurrentPage.WriterName"
subject=""
creator="PDF Creator for Umbraco" />
<fo:layout-master-set>
<fo:simple-page-master master-name="master" page-width="210mm" page-height="297mm" margin-top="1cm" margin-bottom="1cm" margin-left="1cm" margin-right="1cm">
<fo:region-body margin-top="1.5cm" margin-bottom="1.5cm" column-count="2" column-gap="0.5cm"/>
<fo:region-before region-name="header" extent="3cm"/>
<fo:region-after region-name="footer" extent="1.5cm"/>
</fo:simple-page-master>
</fo:layout-master-set>
@* Main content starts within page sequence *@
<fo:page-sequence master-reference="master">
@* Document header *@
<fo:flow flow-name="header">
<fo:block>
<fo:inline font-family="Arial" font-size="23pt" color="#3399ff">
@CurrentPage.Name
</fo:inline>
</fo:block>
<fo:block xsl:use-attribute-sets="kate-test">
Block rocking beats
</fo:block>
</fo:flow>
//----- fie continues to file footer, body and helper functions ------
XSL Attribute Sets - Supported ?
Hello,
I am having a problem getting basic XSL attribute sets working. My simplified example :
This should put a rectangle with a black border at the given position on the page. However, on my output page the styling attributes aren't applied and consequently nothing appears.
On the other hand, when I set the attributes directly on the fo:block-container element like so :
...the output displays as expected.
With regards to the PDF Creator, am I missing something obvious or are XSL attribute sets not supported? I would be most grateful if someone could knock up a simple working example to get me going.
Kind regards,
Scott
P.S. my code is in a Razor macro directly within an Umbraco document template, not in an XSLT macro, if that makes any difference.
After 3 months I'm unlikely to get a response, but does anyone know if attribute sets are supported? I'm having the exact same problem.
Hi Scott,
Yes you can set attribute in your xslt like below and also set out put method as "html"
Hope it will help you
Regrds,
Mehul Gajjar.
As far as I can see, the example about does not work with the xsl-fo used by the PDF creator?
I can't even get the table to display when I insert it into my code, ignoring the styling issue. I am currently outputting the page content using FO-BLOCK and FO_INLINE.
From the top of the file:
//----- fie continues to file footer, body and helper functions ------
Thanks
is working on a reply...