Developer forum
E-mail notifications
How to use the DynamicWeb tag for saving to PDF when printing in XSLT
Posted on 11/01/2011 15:43:05
I have tried the DynamicWeb tag, that only created an error. So I need to convert that functionality so it works in my XSLT template. How do I accomplish this? I have found the tag on Engage "PrintthisPagePDF" but I cant seem to get it to work.
Replies
Posted on 11/01/2011 16:42:46
What was the error?
Do you get a PDF file If you add PDF=true in the querystring? Like /Default.aspx?ID=1&PDF=true
/Morten
Posted on 12/01/2011 08:03:01
Well, yes I do... That is sort of the problem.
I have created my own template that is to be used when a user wants to print a product. The print template has been setup backend on the stylesheet that controls the page, in the selection that controls the PDF print option. I have located the DW tag that refers to this, and Im trying to use that tag, when the user presses the print button so my template is used when printing the produkt, and saving that as .PDF. I have tried the "regular" way of using the tag: "<--" etc. And that doesn´t work. My question is how do you use that tag in an XSLT template?
I have created my own template that is to be used when a user wants to print a product. The print template has been setup backend on the stylesheet that controls the page, in the selection that controls the PDF print option. I have located the DW tag that refers to this, and Im trying to use that tag, when the user presses the print button so my template is used when printing the produkt, and saving that as .PDF. I have tried the "regular" way of using the tag: "<--" etc. And that doesn´t work. My question is how do you use that tag in an XSLT template?
Posted on 16/01/2011 23:24:41
You just need to get the value from DwPrinterfriendly, like this...
<xsl:value-of select="DwPrinterfriendly" disable-output-escaping="yes"/>
The output from DwPrinterfriendly is controlled by your stylesheet settings and the template found here:
/Files/Templates/PageFeatures/Printthis.html
Posted on 17/01/2011 08:27:46
Will that allso save the result as .PDF using my pagetemplate?
Posted on 17/01/2011 12:17:27
Your stylesheet has settings for Printer friendly page (Page features).
1) Make shure the PDF print setttings is pointing at the PDF print stylesheet you want to use.
2) Make shure the PDF print stylesheet is pointing at the page template you want to use for printing.
Alternatively you can control what template is used by adding a template parameter to the PDF link, like this: /Default.aspx?ID=1&PDF=true&Template=MyPageTemplate.xslt
If you still have problems i suggest you call Dynamicweb support :)
/Morten
1) Make shure the PDF print setttings is pointing at the PDF print stylesheet you want to use.
2) Make shure the PDF print stylesheet is pointing at the page template you want to use for printing.
Alternatively you can control what template is used by adding a template parameter to the PDF link, like this: /Default.aspx?ID=1&PDF=true&Template=MyPageTemplate.xslt
If you still have problems i suggest you call Dynamicweb support :)
/Morten
Posted on 24/01/2011 10:00:46
thanks :)
You must be logged in to post in the forum