Free Support Forum - aspose.com

TimeStamp in header overlaps rest of header text

I'm using aspose.words in .net for a few things within my app. I'm adding a timestamp to the firstpage header. I'm also allowing the user to convert the word document to a pdf

The addition of the Timestamp works fine, but when the document is converted to a pdf the timestamp overlaps the exisiting header text. We need to be able to convert the document to pdf and keep the timestamp as it displays in the word document. Please Help!

I have attached a copy of the word docuemnt and below is the code we are using to add the timestamp and convert the document.

'''''''''''''''''''''''''''''''''''''''''Code to covert word document to pdf

Public Shared Function ConvertWordToPdf(ByRef length As Integer, ByVal stream As Stream, ByVal AcceptFinalChanges As Boolean) As Byte()
Try
Dim license As New Aspose.Words.License()
license.SetLicense(HttpContext.Current.Server.MapPath("~\Utility\Aspose.Words.lic"))

'create a new aspose document
Dim doc As New Document(stream)

Dim bytContent As Byte()

Using ms As New MemoryStream()

If (AcceptFinalChanges) Then
'accept all revisions if there are any (pending)
doc.AcceptAllRevisions()

End If

'convert the document to pdf and save into a memory stream
doc.Save(ms, SaveFormat.Pdf)

'set bytcontent equal to the memorystream
bytContent = ms.ToArray()

length = CType(ms.Length, Integer)

End Using

doc = Nothing

Return bytContent
Catch ex As Exception
Throw
Finally
If stream IsNot Nothing Then
stream.Flush()
stream.Close()
End If
End Try Public Shared Function ConvertWordToPdf(ByRef length As Integer, ByVal stream As Stream, ByVal AcceptFinalChanges As Boolean) As Byte()
Try
Dim license As New Aspose.Words.License()
license.SetLicense(HttpContext.Current.Server.MapPath("~\Utility\Aspose.Words.lic"))

'create a new aspose document
Dim doc As New Document(stream)

Dim bytContent As Byte()

Using ms As New MemoryStream()

If (AcceptFinalChanges) Then
'accept all revisions if there are any (pending)
doc.AcceptAllRevisions()

End If

'convert the document to pdf and save into a memory stream
doc.Save(ms, SaveFormat.Pdf)

'set bytcontent equal to the memorystream
bytContent = ms.ToArray()

length = CType(ms.Length, Integer)

End Using

doc = Nothing

Return bytContent
Catch ex As Exception
Throw
Finally
If stream IsNot Nothing Then
stream.Flush()
stream.Close()
End If
End Try

'''''''''''''''''''''''''''''''''''''''''Code to add watermark

' Create a watermark shape. This will be a WordArt shape.
' You are free to try other shape types as watermarks.
Dim watermark As New Shape(doc, ShapeType.TextPlainText)

' Set up the text of the watermark.
watermark.TextPath.Text = "Published on: " + datePublished
watermark.TextPath.FontFamily = "Arial"
watermark.Width = 300
watermark.Height = 10
' Text will be directed from the bottom-left to the top-right corner.
watermark.Rotation = 0
' Remove the following two lines if you need a solid black text.
watermark.Fill.Color = Color.Red
watermark.StrokeColor = Color.Red

watermark.VerticalAlignment = VerticalAlignment.Bottom
watermark.HorizontalAlignment = HorizontalAlignment.Left

' Create a new paragraph and append the watermark to this paragraph.
Dim watermarkPara As New Paragraph(doc)
watermarkPara.AppendChild(watermark)
Return watermarkPara ' Create a watermark shape. This will be a WordArt shape.
' You are free to try other shape types as watermarks.
Dim watermark As New Shape(doc, ShapeType.TextPlainText)

' Set up the text of the watermark.
watermark.TextPath.Text = "Published on: " + datePublished
watermark.TextPath.FontFamily = "Arial"
watermark.Width = 300
watermark.Height = 10
' Text will be directed from the bottom-left to the top-right corner.
watermark.Rotation = 0
' Remove the following two lines if you need a solid black text.
watermark.Fill.Color = Color.Red
watermark.StrokeColor = Color.Red

watermark.VerticalAlignment = VerticalAlignment.Bottom
watermark.HorizontalAlignment = HorizontalAlignment.Left

' Create a new paragraph and append the watermark to this paragraph.
Dim watermarkPara As New Paragraph(doc)
watermarkPara.AppendChild(watermark)
Return watermarkPara

Hi Fred,


Thanks for your inquiry.

While using the latest version of Aspose.Words i.e. 11.5.0, I managed to reproduce this issue on my side. I have logged this issue in our bug tracking system. The issue ID is WORDSNET-6668. Your request has been linked to this issue and you will be notified as soon as it is resolved.

Sorry for the inconvenience.

Best Regards,

Thanks.

We are also having issues with graphic is the header being skewed when the document is being converted to pdf… I think it may be the same root issue

Do you have an ETA for a possible fix for this item? This is affecting one of our high priority clients.

Hi Fred,


Thanks for your inquiry.
Fred:
We are also having issues with graphic is the header being skewed when the document is being converted to pdf… I think it may be the same root issue
Could you please attach your Word document, you’re getting this problem with, here for testing? I will investigate the issue on my side and provide you more information.
Fred:
Do you have an ETA for a possible fix for this item? This is affecting one of our high priority clients.
I'm afraid your issue has now been postponed till a later date. We will inform you as soon as there are any further developments. We're sorry for the inconvenience.

Best Regards,

Here is a sample of the problem file


Pleas note I see the issue on our 2003. but on window 7 the document renders ok

Hi
Fred,


Thanks for your inquiry.

Perhaps, you’re using an older version of Aspose.Words; as with Aspose.Words v11.6.0, I was unable to reproduce this problem during rendering your document to PDF format on my side. I would suggest you please upgrade to the latest version of Aspose.Words i.e. v11.6.0 and let us know how it goes on your side.

I hope, this will help.

Moreover, I have attached the PDF file, i.e generate on my side, here for your reference.

Best Regards,

Hi We have observed that the issue does not occur on our dev environments(windows 7) or our windows server 2008. PDF Graphics render fine. However when using our windows 2003 servers the graphics are distorted.

One theory is that the video drivers are out of date and could be distorting the graphics. Are the video drivers used in the pdf conversion process and could they be affecting the graphics?

Hi Fred,


Thanks for your inquiry. Regarding your question about the usage of video drivers, I have asked this information from our development team. As soon as any information is shared by them, I’ll be glad to share that with you.

Best Regards,

Hi Fred,


Thanks for your patience. It is to confirm that Aspose.Words doesn’t use the capabilities of video drivers during rendering Word documents to PDF format.

Best Regards,

Thank you. Please let me know when you have a resolution to the time stamp issue.

Hi
Fred,


Thanks for your inquiry. Unfortunately, your issue is not resolved yet. I’m afraid your issue has now been postponed till a later date. We will inform you as soon as there are any further developments. We apologise for the inconvenience.

Best Regards,

Are there any updates for this timestamp overlap issue??

Hi Fred,


Thanks for your inquiry. Unfortunately, WORDSNET-6668 is not resolved yet and there is no further news about this issue. This issue has been postponed for now. We will inform you via this thread as soon as this issue is resolved. We apologize for the inconvenience.

Best regards,

The issues you have found earlier (filed as WORDSNET-6668) have been fixed in this Aspose.Words for .NET 17.6 update and this Aspose.Words for Java 17.6 update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.