how do i force a line break in the InteractiveFeatures.Forms.TextBoxField?
Hi,
//open document<o:p></o:p>
Document pdfDocument = new Document();
pdfDocument.Pages.Add();
//create a field
TextBoxField textBoxField = new TextBoxField(pdfDocument.Pages[1], new Aspose.Pdf.Rectangle(100, 200, 300, 300));
textBoxField.PartialName = "textbox1";
textBoxField.Value = "Text Box \n second line";
textBoxField.Multiline = true;
//textBoxField.Border = new Border(
Border border = new Border(textBoxField);
border.Width = 5;
border.Dash = new Dash(1, 1);
textBoxField.Border = border;
textBoxField.Color = Aspose.Pdf.Color.FromRgb(System.Drawing.Color.Green);
//add field to the document
pdfDocument.Form.Add(textBoxField, 1);
//save updated document
pdfDocument.Save(“c:/pdftest/MultilineText_output.pdf”);
is there a way to do this with an existing pdf file?
example:
Dim pdf As New Aspose.Pdf.Document(path)
TryCast(pdf .Form(“txtbox1”), InteractiveFeatures.Forms.TextBoxField).Value = "11111111111111111 \n 2222222222222222 "
TryCast(pdf .Form(“txtbox1”), InteractiveFeatures.Forms.TextBoxField).Multiline = True
the above does not work…
Hi,
Aspose.Pdf.Facades.FormEditor formEditor = new Aspose.Pdf.Facades.FormEditor(“PdfForm.pdf”, “PdfForm_updated.pdf”);
formEditor.Single2Multiple(“textField”);
hi, using your example how do i access the text box field value? I am not sure what resource file you’re wanting but below is example of my code:
--------------------------------------------------------------
Dim filepath As String = Request.PhysicalApplicationPath & “tmp” & sFileName
Dim detail As New Aspose.Pdf.Document(filepath)
'populate textfields in detail page template…
Dim dtData As DataTable = db.getuser(1)
Dim dr As DataRow = dtData.Rows(0)
TryCast(detail.Form(“txtDate_P1”), InteractiveFeatures.Forms.TextBoxField).Value = Date.Today.ToString(“MMM d, yyyy”)
TryCast(detail.Form(“textbox1”), InteractiveFeatures.Forms.TextBoxField).Value = "aaaa \n bbbbbb"
TryCast(detail.Form(“textbox1”), InteractiveFeatures.Forms.TextBoxField).Multiline = True
Hi Chris,