After test this example IE show me the error:

if (year < 1000)
----------^

Blank spaces don't permitted. Maybe

<!DOCTYPE ITEXT SYSTEM "http://www.lowagie.com/iText/itext.dtd">

> There is a sweet Java-based open source project that generates PDF
> based on an XML input format.  The project is called IText and can be
> found here:
   
> http://www.lowagie.com/iText/
>
> If you install the PDF jars from this project into the CFMX classpath
> (itext.jar and itextIXML.jar) and then use the following custom tag,
> you can generate PDF documents.
>
>
> -----pdf.cfm (custom tag)------
> <CFIF ThisTag.ExecutionMode is 'end'>
> <CFSETTING ENABLECFOUTPUTONLY="YES">
> <CFHEADER NAME="content-type" VALUE="application/xml">
> <cfif not isDefined("attributes.fileName")>
> <cfset attributes.deleteOnEndTag=true>
> <CFELSE>
   
> <cfset attributes.deleteOnEndTag=false>
> </CFIF>
> <CFPARAM NAME="attributes.filename"
> DEFAULT="c:\temp\pdf_#createUUID()#.pdf">
> <CFSCRIPT>
> document = createObject("java", "com.lowagie.text.Document").
> init();
> pdfFile = createObject("java", "java.io.FileOutputStream");
> pdfFile.init(attributes.fileName);
> createObject("java", "com.lowagie.text.pdf.PdfWriter").
> getInstance(document, pdfFile);
>
> stringReader = createObject("java", "java.io.StringReader").
> init(thisTag.generatedContent);
> inputSource = createObject("java", "org.xml.sax.InputSource").
> init(stringReader);
> saxHandler = createObject("java", "com.lowagie.text.xml.
> SAXiTextHandler").init(document);
> parser = createObject("java", "javax.xml.parsers.SAXParserFactory").
> newInstance().newSAXParser();
>
> parser.parse(inputSource, saxHandler);
> pdfFile.close();
>
> thisTag.generatedContent = "itext";
> </cfscript>
> <CFCONTENT FILE="#attributes.fileName#" TYPE="application/pdf">
> <cfif attributes.deleteOnEndTag>
> <CFFILE ACTION="" FILE=#attributes.filename#>
> </CFIF>
> </CFIF>
>
>
> -----Example page that outputs PDF------
> <cf_pdf><?xml version="1.0" encoding="UTF-8" ?>
> <!DOCTYPE ITEXT SYSTEM "http://www.lowagie.com/iText/itext.dtd">
> <itext creationdate="Wed Nov 20 13:28:18 CET 2002" producer="iTextXML
> by lowagie.com">
> <paragraph leading="18.0" font="unknown" align="Default">
> Please visit my
> <anchor leading="18.0" font="Helvetica" size="12.0"
> fontstyle="normal, underline" red="0" green="0" blue="255" name="top"
> reference="http://www.lowagie.com/iText/">
> <chunk font="Helvetica" size="12.0" fontstyle="normal, underline"
> red="0" green="0" blue="255">website (external reference)</chunk>
> </anchor>
> </paragraph>
> <paragraph leading="18.0" font="unknown" align="Default">
> These are some special characters: <, >, &, " and
> &apos;
> </paragraph>
> <paragraph leading="18.0" font="unknown" align="Default">
> some books I really like:
> </paragraph>
>
> </itext>
</cf_pdf>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to