HTML to PDF / DOCX / RTF Java converter library › Forums › PD4ML v3 Archived Forums (Read Only) › General questions / FAQ › How to add sent date in the header of the document
- This topic has 12 replies, 2 voices, and was last updated May 15, 2013
17:24:47 byPD4ML.
-
AuthorPosts
-
April 3, 2013 at 14:03#26834
Hi,
I want to add sent date in the header of the pdf file like From,to ,subject the sent date should also display in the headers.It is currently not displaying in the headers.
April 10, 2013 at 11:16#29290Kindly let me know if there is any update on this issue.
April 10, 2013 at 11:49#29291You may add the missing fields to .XSL style condition statements of the following section: ( i.e. ” or ../@name=’Bcc'”). For sent date the correct field name, I guess, is ‘PostedDate’.
<xsl:for-each select="/d:document/d:item/d:rawitemdata[@type='502']"> <xsl:if test="../@name='From' or ../@name='SendTo' or ../@name='Subject' or ../@name='CopyTo'"> <tr> <td valign="top"><xsl:value-of select="../@name"/>:</td><td><span style="text-transform: base64"><xsl:copy-of select="text()"/></span></td> </tr> </xsl:if> </xsl:for-each> <xsl:for-each select="/d:document/d:item/d:text"> <xsl:if test="text() and (../@name='From' or ../@name='SendTo' or ../@name='Subject' or ../@name='CopyTo')"> <tr> <td valign="top"><xsl:value-of select="../@name"/>:</td><td><xsl:copy-of select="text()"/></td> </tr> </xsl:if> </xsl:for-each> <xsl:for-each select="/d:document/d:item/d:textlist/d:text"> <xsl:if test="text() and (../../@name='From' or ../../@name='SendTo' or ../../@name='Subject' or ../../@name='CopyTo')"> <tr> <td valign="top"><xsl:value-of select="../../@name"/>:</td><td><xsl:copy-of select="text()"/></td> </tr> </xsl:if> </xsl:for-each>
April 16, 2013 at 11:54#29292I added as you suggested.But still the date is not displaying in the header.Kindly help.
<xsl:for-each select="//d:item/d:rawitemdata[@type='502']"> <xsl:if test="../@name='From' or ../@name='SendTo' or ../@name='Subject' or ../@name='CopyTo' or ../@name='PostedDate' or ../@name='Bcc'"> <tr> <td valign="top"><xsl:value-of select="../@name"/>:</td><td><span style="text-transform: base64"><xsl:copy-of select="text()"/></span></td> </tr> </xsl:if> </xsl:for-each> <xsl:for-each select="//d:item/d:text"> <xsl:if test="text() and (../@name='From' or ../@name='SendTo' or ../@name='Subject' or ../@name='CopyTo' or ../@name='PostedDate' or ../@name='Bcc')"> <tr> <td valign="top"><xsl:value-of select="../@name"/>:</td><td><xsl:copy-of select="text()"/></td> </tr> </xsl:if> </xsl:for-each> <xsl:for-each select="/d:document/d:item/d:textlist/d:text"> <xsl:if test="text() and (../../@name='From' or ../../@name='SendTo' or ../../@name='Subject' or ../../@name='CopyTo' or ../@name='PostedDate' or ../@name='Bcc')"> <tr> <td valign="top"><xsl:value-of select="../../@name"/>:</td><td><xsl:copy-of select="text()"/></td> </tr> </xsl:if> </xsl:for-each>
April 16, 2013 at 12:05#29293I even tried ‘DisplayDate’ instead of posted date but that also not working.
April 18, 2013 at 11:55#29294You are right, PostedDate is represented with a bit different XML structure. Below is a solution (a section at the bottom)
... <xsl:for-each select="/d:document/d:item/d:rawitemdata[@type='502']"> <xsl:if test="../@name='From' or ../@name='SendTo' or ../@name='Subject' or ../@name='CopyTo' "> <tr> <td valign="top"><xsl:value-of select="../@name"/>:</td><td><span style="text-transform: base64"><xsl:copy-of select="text()"/></span></td> </tr> </xsl:if> </xsl:for-each> <xsl:for-each select="/d:document/d:item/d:text"> <xsl:if test="text() and (../@name='From' or ../@name='SendTo' or ../@name='Subject' or ../@name='CopyTo' )"> <tr> <td valign="top"><xsl:value-of select="../@name"/>:</td><td><xsl:copy-of select="text()"/></td> </tr> </xsl:if> </xsl:for-each> <xsl:for-each select="/d:document/d:item/d:textlist/d:text"> <xsl:if test="text() and (../../@name='From' or ../../@name='SendTo' or ../../@name='Subject' or ../../@name='CopyTo')"> <tr> <td valign="top"><xsl:value-of select="../../@name"/>:</td><td><xsl:copy-of select="text()"/></td> </tr> </xsl:if> </xsl:for-each> <xsl:for-each select="/d:document/d:item[@name='PostedDate']"> <tr> <td valign="top"><xsl:value-of select="@name"/>:</td><td><xsl:copy-of select="."/></td> </tr> </xsl:for-each>
April 18, 2013 at 16:12#29295Hi ,
I tired this but it works for some file but for some of the files the date is printed with junk characters.Attached the sample DXL and converted PDF which prints the junk characters.Also I want to display date in below format 4/18/2013 9:37 PM.Is that possible?
April 18, 2013 at 16:37#29296Yes, with some XSL coding a date formatting is possible.
The “junk characters” also represent a date, but it is base64-encoded. After decoding it will appear as “Wed, 4 Apr 2012 10:43:16 +0300”. In the case, a changing of the format to “4/18/2013 9:37” is more tricky (requires some changes in pd4ml.jar)
I’ll adjust the XSL stylesheet for you, but normally you need MaxAttention support option for such level of support.
It will take few hours.
April 18, 2013 at 17:22#29297here is an updated XSL…
April 22, 2013 at 12:07#29298Thank you very much for your help on this issue.The date is printing now but format is not working if the posted date is raw item data.
The date is printing in below format.
Tue, 13 Dec 2011 13:49:31 +0200
<xsl:if test="d:rawitemdata"> <td> <span style="text-transform: base64"> <xsl:copy-of select="."/> </span> </td> </xsl:if>
Kindly help.
April 22, 2013 at 13:44#29299Currently raw item data is converted to HTML to base64-data tag. CSS style “text-transform: base64” is non-standard, only PD4ML knows how to deal with it. Currently it simply decodes it (and tries to parse/reformat if it is a MIME message).
Currently the decoding module cannot recognise if an encoded raw item is a date and it does not know a target date format. So a solution for the issue would be to implement a new proprietary attribute dateFormat (or something like that) and perform a date conversion when the attribute is present.
The implementation is doable, but it is out of scope of free email support we offer.
Another solution would be to decode the base64 with XSLT means (I just googled http://gandhimukul.tripod.com/xslt/base64-xslt.html ), to cut Lotus specific header bytes from it and to reformat the date as needed, with means of XSLT (as far as I know, there is needed functionality in XSL spec).
May 12, 2013 at 08:40#29300Hi,
I think that if we remove the +0200 from the date then it would be easy to format the date by calling format-date template .Is it possible to remove the +0200 from the date?
Thank you.
May 15, 2013 at 17:24#29301Obviously you may use substring() function for the removal. The following is an XSL date string processing example from our stylesheet.
<xsl:template name="format-date-time"> <!-- 20130328T163613,18-05 --> <xsl:param name="date" select="'%Y%m%dT%H%M%S,%z'"/> <xsl:value-of select="substring($date, 5, 2)"/> <xsl:text>/</xsl:text> <xsl:value-of select="substring($date, 7, 2)"/> <xsl:text>/</xsl:text> <xsl:value-of select="substring($date, 1, 4)"/> <xsl:text> </xsl:text> <xsl:value-of select="substring($date, 10, 2)"/> <xsl:text>:</xsl:text> <xsl:value-of select="substring($date, 12, 2)"/> <xsl:text>:</xsl:text> <xsl:value-of select="substring($date, 14, 2)"/> </xsl:template>
-
AuthorPosts
The forum ‘General questions / FAQ’ is closed to new topics and replies.
