I had a lot of trouble getting printing to work, and also when i got it to work i did not like the result.
Since jdivelog stores in a xml file i created a xsl-fo file that can be used with "apache fop" for example to render divelogs in pdf format.
It is a bit "cludgy" right now, since it depends on the jpeg images of the downloaded logs. So you need to export to HTML format, and then in the xsl-fo file write the path to the export directory:
here it is, for your amusement.:
<?xml version="1.0" encoding="utf-8"?><xsl:stylesheetversion="1.0"xmlns:xsl="http://www.w3.org/1999/XSL/Transform"xmlns:fo="http://www.w3.org/1999/XSL/Format"><xsl:outputmethod="xml"indent="yes"/><xsl:templatematch="/"><fo:root><fo:layout-master-set><fo:simple-page-mastermaster-name="A4-portrait"page-height="29.7cm"page-width="21.0cm"margin="2cm"><fo:region-body/></fo:simple-page-master></fo:layout-master-set><xsl:apply-templatesselect="JDiveLog/JDive"/></fo:root></xsl:template><xsl:templatematch="JDive"><!-- this is the per page template.. --><fo:page-sequencemaster-reference="A4-portrait"><fo:flowflow-name="xsl-region-body"><fo:block><fo:tabletable-layout="fixed"width="100%"><fo:table-columncolumn-width="15mm"/><fo:table-columncolumn-width="130mm"/><fo:table-columncolumn-width="25mm"/><fo:table-body><fo:table-row><!-- border-width="0.5mm" border-style="solid"> --><fo:table-cellborder-width="0.1mm"border-style="solid"padding="0.5mm"><fo:blockfont-size="8pt">Dive nr:</fo:block><fo:blockfont-size="12pt"><xsl:value-ofselect="current()/DiveNum"/></fo:block></fo:table-cell><fo:table-cellborder-width="0.1mm"border-style="solid"padding="0.5mm"><fo:blockfont-size="8pt">Divespot / Water / Town / Country </fo:block><fo:blockfont-size="12pt"><xsl:variablename="di"select="current()/diveSiteId"/><xsl:value-ofselect="/JDiveLog/Masterdata/DiveSites/DiveSite[privateId=$di]/spot"/> /
<xsl:value-ofselect="/JDiveLog/Masterdata/DiveSites/DiveSite[privateId=$di]/waters"/> /
<xsl:value-ofselect="/JDiveLog/Masterdata/DiveSites/DiveSite[privateId=$di]/city"/> /
<xsl:value-ofselect="/JDiveLog/Masterdata/DiveSites/DiveSite[privateId=$di]/country"/></fo:block></fo:table-cell><fo:table-cellborder-width="0.1mm"border-style="solid"padding="0.5mm"><fo:blockfont-size="8pt">Date:</fo:block><fo:blockfont-size="12pt"><xsl:value-ofselect="current()/DATE/YEAR"/>-<xsl:value-ofselect="format-number(current()/DATE/MONTH,'00')"/>-<xsl:value-ofselect="format-number(current()/DATE/DAY,'00')"/></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block><!-- next table with info --><fo:block><fo:tabletable-layout="fixed"width="100%"><fo:table-columncolumn-width="90mm"/><fo:table-columncolumn-width="16mm"/><fo:table-columncolumn-width="17mm"/><fo:table-columncolumn-width="22mm"/><fo:table-columncolumn-width="25mm"/><fo:table-body><fo:table-row><fo:table-cellborder-width="0.1mm"border-style="solid"padding="0.5mm"><fo:blockfont-size="8pt">Buddy/Buddies | Team members</fo:block><fo:blockfont-size="12pt"><xsl:value-ofselect="current()/Buddy"/></fo:block></fo:table-cell><fo:table-cellborder-width="0.1mm"border-style="solid"padding="0.5mm"><fo:blockfont-size="8pt">Time:</fo:block><fo:blockfont-size="12pt"><xsl:value-ofselect="format-number(current()/TIME/HOUR,'00')"/>:<xsl:value-ofselect="format-number(current()/TIME/MINUTE,'00')"/></fo:block></fo:table-cell><fo:table-cellborder-width="0.1mm"border-style="solid"padding="0.5mm"><fo:blockfont-size="8pt">Depth [m]:</fo:block><fo:blockfont-size="12pt"><xsl:value-ofselect="current()/Depth"/></fo:block></fo:table-cell><fo:table-cellborder-width="0.1mm"border-style="solid"padding="0.5mm"><fo:blockfont-size="8pt">Avg Depth [m]:</fo:block><fo:blockfont-size="12pt"><xsl:value-ofselect="current()/Average_Depth"/></fo:block></fo:table-cell><fo:table-cellborder-width="0.1mm"border-style="solid"padding="0.5mm"><fo:blockfont-size="8pt">Duration:</fo:block><fo:blockfont-size="12pt"><!-- om detta kommer frn dykdatorn eller inte r viktigt. --><xsl:choose><xsl:whentest="current()/DIVE"><xsl:value-ofselect="floor(current()/Duration div 60)"/>:<xsl:value-ofselect="floor(current()/Duration mod 60)"/></xsl:when><xsl:otherwise><xsl:value-ofselect="current()/Duration"/></xsl:otherwise></xsl:choose></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block><!-- last part of tableish surface.. here goes the picture and other stuff. --><fo:block><fo:tabletable-layout="fixed"width="100%"><fo:table-columncolumn-width="106mm"/><fo:table-columncolumn-width="64mm"/><fo:table-body><fo:table-row><fo:table-cellborder-width="0.1mm"border-style="solid"><fo:block><xsl:variablename="fp"select="concat('../exportlogs/org/exportlogs/public_html/',current()/DiveNum - 1,'/profile.jpg')"/><fo:external-graphicsrc="{$fp}"content-height="50%"content-width="50%"/></fo:block></fo:table-cell><fo:table-cell><!-- we need a table inside here --><fo:block><fo:tabletable-layout="fixed"width="64mm"><fo:table-columncolumn-width="100%"/><fo:table-body><xsl:iftest="current()/Equipment/Tanks/Tank/MIX/MIXNAME"><fo:table-row><fo:table-cellborder-width="0.1mm"border-style="solid"padding="0.5mm"><fo:blockfont-size="8pt">GAS:</fo:block><fo:blockfont-size="12pt"><xsl:value-ofselect="current()/Equipment/Tanks/Tank/MIX/MIXNAME"/></fo:block></fo:table-cell></fo:table-row></xsl:if><xsl:iftest="normalize-space(current()/DiveType)"><fo:table-row><fo:table-cellborder-width="0.1mm"border-style="solid"padding="0.5mm"><fo:blockfont-size="8pt">DIVE TYPE:</fo:block><fo:blockfont-size="12pt"><xsl:value-ofselect="current()/DiveType"/></fo:block></fo:table-cell></fo:table-row></xsl:if><xsl:iftest="normalize-space(current()/DiveActivity)"><fo:table-row><fo:table-cellborder-width="0.1mm"border-style="solid"padding="0.5mm"><fo:blockfont-size="8pt">DIVE ACTIVITY:</fo:block><fo:blockfont-size="12pt"><xsl:value-ofselect="current()/DiveActivity"/></fo:block></fo:table-cell></fo:table-row></xsl:if><!-- if visability has been added --><xsl:iftest="normalize-space(current()/Visibility)"><fo:table-row><fo:table-cellborder-width="0.1mm"border-style="solid"padding="0.5mm"><fo:blockfont-size="8pt">Visibility:</fo:block><fo:blockfont-size="12pt"><xsl:value-ofselect="current()/Visibility"/></fo:block></fo:table-cell></fo:table-row></xsl:if><xsl:iftest="normalize-space(current()/TEMPERATURE)"><fo:table-row><fo:table-cellborder-width="0.1mm"border-style="solid"padding="0.5mm"><fo:blockfont-size="8pt">WATER TEMP [Celcius]:</fo:block><fo:blockfont-size="12pt"><xsl:iftest="current()/TEMPERATURE > '200'"><xsl:value-ofselect="floor(current()/TEMPERATURE - 273)"/></xsl:if><xsl:iftest="current()/TEMPERATURE < '200'"><xsl:value-ofselect="current()/TEMPERATURE"/></xsl:if></fo:block></fo:table-cell></fo:table-row></xsl:if></fo:table-body></fo:table></fo:block></fo:table-cell></fo:table-row></fo:table-body></fo:table></fo:block><fo:blockfont-size="10pt"><xsl:value-ofselect="current()/Comment"/></fo:block></fo:flow></fo:page-sequence></xsl:template></xsl:stylesheet>
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello all!
I had a lot of trouble getting printing to work, and also when i got it to work i did not like the result.
Since jdivelog stores in a xml file i created a xsl-fo file that can be used with "apache fop" for example to render divelogs in pdf format.
It is a bit "cludgy" right now, since it depends on the jpeg images of the downloaded logs. So you need to export to HTML format, and then in the xsl-fo file write the path to the export directory:
here it is, for your amusement.: