The applicable source is:
Dim outDoc As PdfDocument = New PdfDocument
outDoc.LoadFromFile(strTemplateName)
Dim form As PdfFormWidget = CType(outDoc.Form, PdfFormWidget)
Dim formWidgetCollection As PdfFormFieldWidgetCollection = form.FieldsWidget
Dim i As Integer
For i = 0 To formWidgetCollection.Count - 1 Step i + 1
- Dim field As PdfField = formWidgetCollection(i)
- If TypeOf field Is PdfTextBoxFieldWidget Then
- - Dim textBoxField As PdfTextBoxFieldWidget = CType(field, PdfTextBoxFieldWidget)
- - Select Case field.Name
- - - Case "BARCODE"
- - - - textBoxField.Text = PTLField(parFI.Name, ".", 2)
- - End Select
- End If
Next
outDoc.PrintSettings.PrinterName = "Microsoft Print to PDF"
outDoc.PrintSettings.PrintToFile(strNewPDFName)
outDoc.Print()
outDoc.Close()
When running this code either on my development machine or the server, the final printed PDF displays the ASCII text instead of the barcode.
Can anyone highlight what I have done wrong or what I might be missing?