tags:

views:

72

answers:

2

I have one huge XML document. I have set of XSL representing each node in the XML. These XSL also have java script to generate the dynamic content. It uses images which are in seperate images folder and it uses fonts as well. At present, I have a program which displays all the nodes that can be transformed and user click on one of the node and the program performs XSLT and display the content in HTML format on IE screen.

I want to write a program (.Net , C# or any .Net language) which will allow user to do XSLT tranform on all the available notes and create one PDF document. My initial requirement was to display all the document in the IE itself, so I reused the existing code, and foreach node, perform XSLT and then append it to the current HTML with a page break and it worked ok till we hit huge files. So the requirement changed to create one PDF file with all the nodes.

I have couple of questions, 1. What is the best way to create PDF file using XSLT transformation? 2. Since the images are relative path, if we generate the XSLT in html and then write it to a output stream will it loose the images? 3. Will the font be preserved in the PDF document?

Really appriciate if someone could point me to some good example that I can take and run with it. Thanks a lot.

A: 

You should look into using XSL-FO with the XSLT. This is the formatting language for XSL and it can generate a PDF file from the transformation. It is supposed to work really well with images and layouts.

See this tutorial: http://www.w3schools.com/xslfo/default.asp

Hope that helps! :D

developer