string LatexGenerator::getHeader() { ostringstream os; os << "\\documentclass{article}\n" << "\\usepackage{color}\n" << "\\usepackage{alltt}\n"; if (StringTools::lowerCase(encoding)=="utf-8"){ os << "\\usepackage{ucs}\n\\usepackage[utf8x]{inputenc}\n"; } else if (encodingDefined()){ os << "\\usepackage[latin1]{inputenc}\n"; } if (langInfo.getSyntaxHighlight()) { if (includeStyleDef) { os << "\n"<<getStyleDefinition(); os << CodeGenerator::readUserStyleDef(); } else { os << "\n\\input {" << getStyleOutputPath() << "}\n"; } } os << "\n\\title{" << docTitle << "}\n" << "\\begin{document}\n" << "\\pagecolor{bgcolor}\n"; return os.str(); }
string HtmlGenerator::getHeader() { ostringstream os; os << getHeaderStart(docTitle); if (!useInlineCSS){ if (includeStyleDef) { os << "<style type=\"text/css\">\n<!--\n"; os << getStyleDefinition(); os << CodeGenerator::readUserStyleDef(); os << "//-->\n</style>\n"; } else { os << "<link rel=\"stylesheet\" type=\"text/css\" href=\"" << getStyleOutputPath() << "\">\n"; } os << "</head>\n<body class=\"" << cssClassName << "\">\n"; } else { os << "</head>\n<body style=\"" << "background-color:#" << (docStyle.getBgColour().getRed(HTML)) << (docStyle.getBgColour().getGreen(HTML)) << (docStyle.getBgColour().getBlue(HTML)) << "\">\n"; } return os.str(); }
string ODTGenerator::getHeader() { string enc = "UTF-8"; if ( encodingDefined() ) { enc = encoding; } ostringstream header; header << "<?xml version=\"1.0\" encoding=\""<<enc<<"\"?>\n"\ "<office:document xmlns:office=\"urn:oasis:names:tc:opendocument:xmlns:office:1.0\" xmlns:style=\"urn:oasis:names:tc:opendocument:xmlns:style:1.0\""\ " xmlns:text=\"urn:oasis:names:tc:opendocument:xmlns:text:1.0\" xmlns:table=\"urn:oasis:names:tc:opendocument:xmlns:table:1.0\""\ " xmlns:draw=\"urn:oasis:names:tc:opendocument:xmlns:drawing:1.0\" xmlns:fo=\"urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0\""\ " xmlns:xlink=\"http://www.w3.org/1999/xlink\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:meta=\"urn:oasis:names:tc:opendocument:xmlns:meta:1.0\""\ " xmlns:number=\"urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0\" xmlns:svg=\"urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0\""\ " xmlns:chart=\"urn:oasis:names:tc:opendocument:xmlns:chart:1.0\" xmlns:dr3d=\"urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0\""\ " xmlns:math=\"http://www.w3.org/1998/Math/MathML\" xmlns:form=\"urn:oasis:names:tc:opendocument:xmlns:form:1.0\" xmlns:script=\"urn:oasis:names:tc:opendocument:xmlns:script:1.0\""\ " xmlns:config=\"urn:oasis:names:tc:opendocument:xmlns:config:1.0\" xmlns:ooo=\"http://openoffice.org/2004/office\" xmlns:ooow=\"http://openoffice.org/2004/writer\""\ " xmlns:oooc=\"http://openoffice.org/2004/calc\" xmlns:dom=\"http://www.w3.org/2001/xml-events\" xmlns:xforms=\"http://www.w3.org/2002/xforms\""\ " xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:rpt=\"http://openoffice.org/2005/report\""\ " xmlns:of=\"urn:oasis:names:tc:opendocument:xmlns:of:1.2\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" xmlns:grddl=\"http://www.w3.org/2003/g/data-view#\""\ " xmlns:tableooo=\"http://openoffice.org/2009/table\" xmlns:field=\"urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0\""\ " xmlns:formx=\"urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0\" xmlns:css3t=\"http://www.w3.org/TR/css3-text/\" office:version=\"1.2\""\ " office:mimetype=\"application/vnd.oasis.opendocument.text\">\n"\ " <office:font-face-decls>\n"\ " <style:font-face style:name=\""<< getBaseFont()<<"\" svg:font-family=\""<< getBaseFont()<<"\" style:font-family-generic=\"modern\" style:font-pitch=\"fixed\"/>\n"\ " </office:font-face-decls>\n"; header << getStyleDefinition(); header << " <office:body>\n" << " <office:text>\n" << "<text:p text:style-name=\"Standard\">"; return header.str(); }
string SVGGenerator::getHeader() { ostringstream header; header << "<?xml version=\"1.0\""; if ( encodingDefined() ) { header << " encoding=\"" << encoding << "\""; } header << "?>\n"; if ( !includeStyleDef ) { header << "<?xml-stylesheet type=\"text/css\" href=\"" << getStyleOutputPath() << "\"?>\n"; } header << "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.2//EN\" " << "\"http://www.w3.org/Graphics/SVG/1.2/DTD/svg12.dtd\">\n"; header << "<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.2\" " << "baseProfile=\"full\" xml:space=\"preserve\""; if ( width.size() ) header << " width=\""<<width<<"\""; if ( height.size() ) header << " height=\""<<height<<"\""; //viewBox=\"0 0 800 600\" header << ">\n<desc>" << docTitle << "</desc>\n"; if ( includeStyleDef ) { header << "<defs>\n"; header << getStyleDefinition(); header << "\n</defs>\n"; } return header.str(); }
string XmlGenerator::getHeader() { ostringstream header; header << "<?xml version=\"1.0\""; if ( encodingDefined() ) { header << " encoding=\"" << encoding << "\""; } header << "?>\n<document>"; header << "\n<title>" << docTitle << "</title>"; header << getStyleDefinition(); return header.str(); }