AnsweredAssumed Answered

error:: file does not begin with '%PDF-'

Question asked by reshma on Mar 4, 2009
Hi All,

    I want to create webform for generating pdf format (insted html for view), while creating webform I gave Rendition mimetype: Adobe PDF document and Output path pattern: ${name}.pdf 

     like this, by using this webform I am creating one WebContent after creating Content, the file is generating in pdf format only, but I try to see that file it is giving this error:: file does not begin with '%PDF-' and I don't know what is
the problem I think in xsl I need to do some changes for PDF, here I am pasting my xsl code can any one help me ..

<?xml version="1.0" encoding="UTF-8"?>
<!– Produces an html rendition of a meeting –>
<xsl:stylesheet version="1.0" xmlns:xhtml="http://www.w3.org/1999/xhtml"
   xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ps="http://www.alfresco.org/alfresco/ps"
   xmlns:fn="http://www.w3.org/2005/02/xpath-functions"
   exclude-result-prefixes="xhtml">
   <xsl:output method="html" encoding="UTF-8" indent="yes"
      doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
      doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" />
   <xsl:preserve-space elements="*" />
   <xsl:template match="/">
      <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
         <head>
            <title>Text Page</title>
            <meta http-equiv="Content-Type" content="application/pdf; charset=iso-8859-1" />
            <LINK href="../home/style.css" type="text/css" rel="stylesheet" />
            <style> .noscroll { overflow-x:hidden; overflow-y:unhidden; }
            </style>
         </head>
         <body topmargin="0" leftmargin="0" marginheight="0" marginwidth="0"
            bgcolor="#FFFFFF">
            <table width="100%" border="0" cellspacing="0" cellpadding="0"
               align="left" height="100%">
               <tr>
                  <td width="100%" align="center">
                     <div align="center">
                        <table width="525" border="0" cellspacing="2" cellpadding="5"
                           align="center">
                           <tr bgcolor="">
                              <td width="" class="lta">
                                 <div align="center">
                                    Name:
                                    <b>
                                       <xsl:value-of select="/ps:barcode/ps:publish_name" />
                                    </b>
                                 </div>
                                 <div align="center">
                                    City:
                                    <b>
                                       <xsl:value-of select="/ps:barcode/ps:publish_city" />
                                    </b>
                                 </div>
                              </td>
                           </tr>
                        </table></div></td></tr></table>
         </body>
      </html>
   </xsl:template>
</xsl:stylesheet>
thanks in advance

Outcomes