sicher im xsl-fo...
break-after , break-before die volle referens ...
http://www.zvon.org/xxl/xslfoReference/ ... index.html
ist 30 mal einfacher zu lernen als qt4
Code: Alles auswählen
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" >
<fo:layout-master-set>
<fo:simple-page-master page-height="11in" page-width="8.5in" margin-left="1.0in" margin-top="0.2in" margin-bottom="1.0in" margin-right="1.0in" master-name="test-page-master">
<fo:region-body margin-left="1.0in" margin-top="0.2in" margin-right="1.0in" margin-bottom="1.0in"/>
</fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence master-name="test-page-master">
<fo:flow flow-name="xsl-region-body">
<fo:block-container break-after="page">
<fo:block>This test generate two pages. This text appear on the first page</fo:block>
</fo:block-container>
<fo:block-container>
<fo:block>This text appear on the second page.</fo:block>
</fo:block-container>
</fo:flow>
</fo:page-sequence>
</fo:root>
seiten nummerieren so..
im block "xsl-region-after am fuss der seite oder befor am kopf der seite....
Code: Alles auswählen
<fo:block>
<xsl:attribute name="text-align">end</xsl:attribute>
<xsl:attribute name="font-size">10pt</xsl:attribute>
<xsl:attribute name="font-family">Helvetica</xsl:attribute>
<xsl:attribute name="color"><xsl:value-of select="$hellgrau"/></xsl:attribute>
<xsl:attribute name="padding-before">10pt</xsl:attribute>
Seite <fo:page-number/>
</fo:block>
<!-- pdf bookmark so -->
<!-- make bookmark! -->
<xsl:template name="bookimarker">
<fox:outline internal-destination="tipx12">
<fox:label>BSA Member Liste</fox:label>
<xsl:for-each select="/bsa/field/rows">
<xsl:variable name="anzahl" select="child::MG" />
<xsl:variable name="forma" select="child::Anrede" />
<xsl:variable name="cognome" select="child::NName" />
<xsl:variable name="nome" select="child::Vorname" />
<xsl:text>
</xsl:text>
<fox:outline>
<xsl:attribute name="internal-destination"><xsl:value-of select="concat('tipx', $anzahl)"/></xsl:attribute>
<fox:label><xsl:value-of select="concat($forma, ' ', $cognome,' ',$nome)"/>
</fox:label>
</fox:outline>
</xsl:for-each>
</fox:outline>
</xsl:template>
<!-- make bookmark! --
wen du nicht gut vertraut bist mit xml .... schreibe alles ins richtige xhtml wie qt richtexteditor.... dann transormierst es nach xsl-fo ... mit diesem file...
http://webcoder.info/downloads/xhtml2fo.html xhtml2fo.xsl und am ende zu pdf ....
und mit qt den fo file zum hocwertigem pdf bringen...
Code: Alles auswählen
/* external java fop setup & convert */
bool Xslt_Proc::Fopjava( QString fofile , QString pdffile )
{
#ifndef JAVA_HOME
#define JAVA_HOME \
QString( "%1/" ).arg( getenv("JAVA_HOME") )
#endif
/* http://xmlgraphics.apache.org/fop/ only java api
http://mirror.switch.ch/mirror/apache/dist/xmlgraphics/fop/binaries/fop-0.92beta-bin-jdk1.4.zip */
QString bindirapp;
#if defined(Q_WS_WIN)
bindirapp = QCoreApplication::applicationDirPath()+"/fop/fop.bat";
#else /* mac linux */
/* test "which fop" */
bindirapp = "/opt/fop/fop";
#endif
if (!is_file(bindirapp)) {
xslterrormsg = "Error...! fop apache is not install... download a copy on http://xmlgraphics.apache.org/fop/ and copy to "+bindirapp;
return false;
}
if (JAVA_HOME.size() > 3) {
QProcess process;
process.setReadChannelMode(QProcess::MergedChannels);
process.start( bindirapp , QStringList() << fofile << pdffile);
if (!process.waitForFinished()) {
xslterrormsg = "Error...! Transormtation! \n" + process.errorString() + "\nprogramm " +bindirapp;
return false;
} else {
xslterrormsg = "Success Transormtation! \n" + process.readAll() + "\nprogramm " +bindirapp;
return true;
}
} else {
xslterrormsg = "Error...! JAVA is not install.....";
return false;
}
}
wenn du dich mit xml schnell zurecht findest mache deine eigene tag...
<para/> +8 attribute
<bold/>
<italic/>
<link/> +2 attribute
<center/>
<seiteumbruch/>
<title/>
<subtitle/>
<image/> +4 attribute
und dann ein ein converter schreiben zu xsl-fo mit deine regeln bilder ecc...
publiziere sonst irgenwo im netz deine beispiel xml...
oder noch ein beispiel ... von sql zu xml und dan zu pdf mit bookmark...
http://ciz.ch/svnciz/xls2sql/fas_bsa_pdf.xsl