I have just submitted an email to support, but I am making this post so that I can either reply the answer for others or maybe someone in the meanwhile can reply an answer/fix.
When I add two TextAreas onto a page:
Dim txtAreaWithLink As New TextArea("http://www.pps.k12.or.us/schools/boise-eliot", 5, 5, 200, 20, otf, 10)
pg.Elements.Add(txtAreaWithLink)
Dim txtAreaWithoutLink As New TextArea("TEST", 5, 30, 200, 20, otf, 10)
pg.Elements.Add(txtAreaWithoutLink)
doc.Pages.Add(pg)
In the generated PDF, when I click on the URL for the first TextArea it will attempt to launch the address: http://www.pps.k12.or.us/schools/boise-eliotTEST
This seems to only happen when a hyphen is in the URL string sent into the TextArea
Any help is appreciated.
-Scott
Hyphen in URL string in TextArea Causes next available TextArea to concatenate into the link
Re: Hyphen in URL string in TextArea Causes next available TextArea to concatenate into the link
Support · Sep 19, 2013Hello Scott,
Our developers verified the PDF generated by DynamicPDF and there is an end of line added at the end of the TextArea, so between the url and next line of text, there is an end of line present. However the Adobe Reader is ignoring this and combining the text in both lines. So our developers concluded that this is an issue with the Adobe Reader’s functionality.
To avoid this you can use a Link page element (for urls) instead of a TextArea. Here is the sample code that shows how to add a link.
Dim doc As New ceTe.DynamicPDF.Document
Dim pg As New Page(PageSize.Letter, PageOrientation.Portrait, 0)
Dim otf As New ceTe.DynamicPDF.Text.OpenTypeFont("fonts\arial.ttf")
Dim urlText As String = "http://www.pps.k12.or.us/schools/boise-eliot"
Dim fontSize As Single = 10
Dim width As Single = otf.GetTextWidth(urlText, fontSize)
Dim linkLabel As Label = New Label(urlText, 5, 5, 200, 20, otf, fontSize, RgbColor.Blue)
linkLabel.Underline = True
Dim action As UrlAction = New UrlAction(urlText)
Dim link As Link = New Link(5, 5, width, 20, action)
pg.Elements.Add(linkLabel)
pg.Elements.Add(link)
Dim txtAreaWithoutLink As New TextArea("TEST", 5, 30, 200, 20, Font.Helvetica, 10)
pg.Elements.Add(txtAreaWithoutLink)
doc.Pages.Add(pg)
doc.DrawToWeb()
Thanks,
ceTe Software Support Team.