Home > Net >  Excuse me what method can put the words written in the PDF form?
Excuse me what method can put the words written in the PDF form?

Time:09-17

If inscribe

Such as the PDF shown below, in some form, if you need to write text form, should have what kind of method?


CodePudding user response:

Do you use baidu search c # PDF

CodePudding user response:

PDF document itself does not exist in the concept of table, couldn't get the table object, can only specify a location map content, PDF to add content you need to specify the specific coordinates, if you want to in the above text can try the following become code
 Imports Spire. PDF 
Imports Spire. Pdf. Graphics
Public Class Form1

Private Sub btn_Run_Click (sender As Object, As EventArgs e) Handles btn_Run. Click
'Create a PDF document
Dim doc As New PdfDocument ()

'from the system load file
Doc. LoadFromFile (" C: \ Program Files \ e - iceblue \ Spire Pdf - Fe \ Demos \ Data \ DrawContentWithSpotColor Pdf ")
Get the first page of the PDF document
Dim page As PdfPageBase=doc. Pages (0)

AlignText (page)


'save the PDF document
Doc. SaveToFile (" TextDraw. PDF ")
Doc. The Close ()


'to start the PDF documentPDFDocumentViewer (" TextDraw. PDF ")

End Sub

Private Sub AlignText (ByVal page As PdfPageBase)
'draw text - alignment
Dim the font As New PdfFont (20.0 F) PdfFontFamily Helvetica,
Dim brush As New PdfSolidBrush (Color. Blue)

Dim leftAlignment As New PdfStringFormat (PdfTextAlignment. Left, PdfVerticalAlignment. Middle)
'set the position of the draw text
Page. Canvas. DrawString (" Left!" , the font, brush, 0, 200, leftAlignment)
Page. Canvas. DrawString (" Left!" , the font, brush, 0, 250, leftAlignment)

Dim rightAlignment As New PdfStringFormat (PdfTextAlignment. Right, PdfVerticalAlignment. Middle)
Page. Canvas. DrawString (" Right!" , the font, brush, page. Canvas. ClientSize. Width, 200, rightAlignment)
Page. Canvas. DrawString (" Right!" , the font, brush, page. Canvas. ClientSize. Width, 250, rightAlignment)

Dim centerAlignment As New PdfStringFormat (PdfTextAlignment. Center, PdfVerticalAlignment. Middle)
Page. Canvas. DrawString (" Go! Turn Around! Go! Go! Go!" , the font, brush, CLng (page. Canvas. ClientSize. Width) \ 2, 240, centerAlignment)

End Sub
Private Sub PDFDocumentViewer (ByVal fileName As String)
Try
Process. The Start (fileName)
Catch
End the Try
End Sub

The End of the Class
,

CodePudding user response:

Spire. PDF, and how to operate the Form part of the content, but this is to charge, you can find the cracked version...

CodePudding user response:

posts to remember here,

Thanks for two great god above solutions, mua
  • Related