locked
Wordml to pdf RRS feed

  • Question

  • User183689629 posted

    Hi guys,

    I am looking to convert a wordml document (.xml which opens in word 2003) to pdf. I would appreciate if anyone could guide me for such a component.

     Thanks

    Tuesday, November 14, 2006 12:22 PM

All replies

  • User1854603698 posted
    <!-- CONTENT -->

    Generating PDF from ASP.NET solution

    Altsoft Xml2PDF ASP.NET connector provides an easy way to generate PDF streams directly from ASP.NET pages in the same way as usual HTML pages. To do this you can dynamically create an XML page in any format supported by Altsoft Xml2PDF and filter it though the Altsoft Xml2PDF formatting engine. The generated PDF will be streamed to the client application.

    ASP.NET developers can enjoy the familiar development framework to create Web solutions generating and distributing dynamic PDF documents immediately by client request. In particular, you can code your .aspx pages with XSL-FO, SVG, XHTML or WordML instead of HTML and have a formatted PDF in the response stream. This technique can help you to avoid using stylesheets, templates, transformations and other processes usually required to produce PDF file and keep working within the standard ASP.NET way by automating a page source.

    The ASP.NET connector is distributed as a free add-on to the Xml2PDF .NET API.

    The sample below demonstrates how to create a drawing in PDF using SVG as an intermediate format.

     

    Source Code Sample

    <?xml version="1.0" encoding="ISO-8859-1"?>
    <%@ Page language="c#" AutoEventWireup="false" Inherits="Altsoft.Web.UI.SvgPage" %>
    <svg xmlns="http://www.w3.org/2000/svg" width="400" height="400">
    <%
    for( int i=0; i<100; i+=2)
    {
    %><ellipse
    cx="200"
    cy="<%=300-i%>"
    rx="<%=i/1.7+30%>"
    ry="10" fill="none"
    stroke="black"/>
    <%
    }
    %>
    </svg>

     

    Source Code Description

    <?xml version="1.0" encoding="ISO-8859-1"?>

    XML declaration that specifies that this is an XML file and specifies the encoding of the page. This declaration must be the first line of the page. Otherwise this file will not be recognized as a correct XML file.

    Inherits="Altsoft.Web.UI.SvgPage"

    This page inherits Altsoft's System.Web.UI.Page overload for SVG. It allows you to work with a web page as an SVG file. And SvgPage will convert it to PDF for you. There are also overloads for XSL-FO, XHTML and WordML pages available.

    <svg xmlns="http://www.w3.org/2000/svg"
    xml:space="preserve" width="400" height="400">
    <%
    for( int i=0; i<100; i+=2)
    {
    %><ellipse
    cx="200"
    cy="<%=300-i%>"
    rx="<%=i/1.7+30%>"
    ry="10" fill="none"
    stroke="black"/><%
    }
    %>
    </svg>

    SVG tags are mixed with ASP.NET code and produce a dynamic SVG picture.

     

    PDF Result

    PDF produced from SVG with Xml2PDF for ASP.NET

    Monday, December 11, 2006 10:20 AM
  • User-1658369456 posted

    There are basically 2 ways to accomplish this:

    1) Server solutions that don't need Word to generate the PDF:

    If you are looking for a non commercial solutions there are a couple of stylesheets on the internet that will convert your XML to XSL-FO. From there you can use any XSL-FO compliat engine (including free ones)!

    But if you can afford a commercial solution it will be much better because you will also get support for DOCX (which is the format supported by Word 2007 and an ECMA standard). From all server solutions out there my company chose Ecrion XF Rendering Server because it matches the best Microsoft Word and it can run on both Windows and Linux.

    2) Solutions that are more targeted to desktop user's needs that will basically "print" the document to a PDF printer driver. They are not scalable because the Windows printing mechanism was not designed for this purpose and require Word to be installed.

    In my opinion, 1 is the only option if you want to run the conversion on the server.

    Wednesday, February 3, 2010 9:45 PM