We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Problem with FreeTextAnnotation

I am attempting to create a FreeTextAnnotation with the code below. I opened the PDF to edit it manually and it appeared to be black, but when I clicked around the lower left part of the document I found the Annotation box which was completely blank until I re-sized it, at which point the text appeared.

Sub Main()

Dim pdfDocument As New Aspose.Pdf.Document()

Dim page As Aspose.Pdf.Page = pdfDocument.Pages.Add()

Dim llLeft As Integer = 100

Dim llBottom As Integer = 100

Dim llRight As Integer = 200

Dim llTop As Integer = 200

Dim lsText As String = "This is the line of text that I put here."

Dim lsFont As String = "Arial"

Dim fontSize As Integer = 10

Dim borderWidth As Integer = 1

Dim pdfFreeText As New Aspose.Pdf.InteractiveFeatures.Annotations.FreeTextAnnotation(

page, New Aspose.Pdf.Rectangle(llLeft, llBottom, llRight, llTop), Nothing)

pdfFreeText.Contents = lsText

Dim border As New Aspose.Pdf.InteractiveFeatures.Annotations.Border(pdfFreeText)

border.Width = borderWidth

page.Annotations.Add(pdfFreeText)

pdfDocument.Save("output.pdf")

End Sub

Hi Daniel,


Thanks for your inquiry. I am afraid we are unable to replicate the issue with laters version of Aspose.Pdf for .NET i.e. 9.3.0., sample output is enclosed here. Please download and try latest version of Aspose.Pdf for .NET, it will help you to resolve the issue.

Please feel free to contact us for any further assistance.

Best Regards,