Developer forum

Forum » Templates » How to use the DynamicWeb tag for saving to PDF when printing in XSLT

How to use the DynamicWeb tag for saving to PDF when printing in XSLT


Reply
 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

 
Reply

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
 
Reply
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?    
 
Reply
 
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
 
Reply
Will that allso save the result as .PDF using my pagetemplate? 

 
Reply
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
 
Reply
 thanks :)

 

You must be logged in to post in the forum