Hello,
Can the PDF Editor Toolkit Pro SDK add text to an existing multipage PDF with the ability to add the text to any of the pages in the PDF?
I have some documents with several pages of images in the PDF and I would like to print various text on each page.
Thanks
Customer
----------------------------------------------------------------
>>Can the Pro SDK add text to an existing multipage PDF with the ability to add the text to any of the pages in the PDF?
>>I have some documents with several pages of images in the PDF and I would like to print various text on each page.
Yes, you can add text and images to PDF pages on the any position, you may download the trial version of PDF Editor Toolkit Pro SDK from our website to try,
https://www.verypdf.com/app/pdf-editor-toolkit/try-and-buy.html#pro
https://www.verypdf.com/pdfsdk/pdf_editor_toolkit_pro_trial.zip
If you encounter any problem with PDF Editor Toolkit Pro SDK product, please feel free to let us know, we will assist you asap.
VeryPDF
----------------------------------------------------------------
I have downloaded the toolkit and used the VeryAddText() function to add text to a PDF that I had created via VeryCreate() and added a page via VerySetFunction(109). But I do not understand how to add text to an existing PDF and place text on page 3 for example.
Thanks
Customer
----------------------------------------------------------------
You an use VeryStampOpen() function to open a PDF file, and use VeryStampAddText() function to add the text contents to PDF pages, please look at following VB example,
Private Declare Function VeryStampOpen Lib "verywrite.dll" (ByVal sIn As String, ByVal sOut As String) As Long
Private Declare Sub VeryStampClose Lib "verywrite.dll" (ByVal id As Long)
Private Declare Function VeryStampSetFunction Lib "verywrite.dll" (ByVal id As Long, ByVal func_code As Long, ByVal Para1 As Long, ByVal Para2 As Long, ByVal szPara3 As String, ByVal szPara4 As String) As Long
Private Declare Function VeryStampGetFunction Lib "verywrite.dll" (ByVal id As Long, ByVal func_code As Long, ByVal Para1 As Long, ByVal Para2 As Long, ByVal szPara3 As String, ByVal szPara4 As String) As Long
Private Declare Function VeryStampAddImage Lib "verywrite.dll" (ByVal id As Long, ByVal position As Long, ByVal filename As String, ByVal shift_lr As Long, ByVal shift_tb As Long, ByVal rotate As Long, ByVal layer As Long, ByVal zoomW As Long, ByVal zoomH As Long, ByVal action As Long, ByVal link As String, ByVal pageno As Long) As Long
Private Declare Function VeryStampAddText Lib "verywrite.dll" (ByVal id As Long, ByVal position As Long, ByVal sstring As String, ByVal color As Long, ByVal alignment As Long, ByVal shift_lr As Long, ByVal shift_tb As Long, ByVal rotate As Long, ByVal layer As Long, ByVal hollow As Long, ByVal fontcode As Long, ByVal fontname As String, ByVal fontsize As Long, ByVal action As Long, ByVal link As String, ByVal pageno As Long) As Long
Private Declare Function VeryStampAddLine Lib "verywrite.dll" (ByVal id As Long, ByVal position As Long, ByVal line_width As Long, ByVal color As Long, ByVal shift_lr As Long, ByVal shift_tb As Long, ByVal rotate As Long, ByVal layer As Long, ByVal zoomW As Long, ByVal zoomH As Long) As Long
Private Declare Sub VerySetLicenseKey Lib "verywrite.dll" (ByVal szLicenseKey As String)
'define for VerySetFunction
Const Very_Set_Range = 131
Private Sub Command1_Click()
Dim szPDFFile As String
Dim id As Long
Dim code As Long
Dim lFile As Long
Dim NullString As String
VerySetLicenseKey("XXXXXXXXXXXXXXXXXXXXXXXX")
szPDFFile = "example.pdf"
'//%text stamp%
'//%page header and page footer%
'//%Stamps are placed in the duplicate file, leaving the original copy unchanged%
id = VeryStampOpen(szPDFFile, "1.pdf")
If (id > 0) Then
code = VeryStampAddText(id, 7, "\d\n\t", 255, 0, 50, -30, 0, 0, 0, 0, NullString, 10, 0, NullString, 0)
code = VeryStampAddText(id, 5, "Page \P3+1 of \c", 255, 0, -50, -30, 0, 0, 0, 0, NullString, 10, 0, NullString, 0)
code = VeryStampAddText(id, 3, "2003 verypdf.com Inc.", 2666666, 0, -30, 30, 0, 0, 0, 300, NullString, 10, 0, NullString, 0)
VeryStampClose(id)
End If
'//%.Supports Font Style, Font Size, Text Modes (solid, outline), Grayscale and RGB Color (0-255 RGB color values supported) %
'//%.Top, bottom, vertical center, diagonal-top left and diagonal-bottom left. %
'//%·Supports multiple line text stamps within one stamp item %
id = VeryStampOpen(szPDFFile, "2.pdf")
If (id > 0) Then
code = VeryStampAddText(id, 3, "Sample File\nverypdf", 0, 0, 0, 0, 0, 0, 0, 300, NullString, 0, 0, NullString, 0)
code = VeryStampAddText(id, 6, "Copyright verypdf.com, Inc.", RGB(255, 200, 100), 0, 0, 0, 0, 0, 0, 0, NullString, 0, 0, NullString, 0)
code = VeryStampAddText(id, 9, "www.verypdf.com\n Demo", 255, 0, 0, 0, -45, 0, 1, 200, NullString, 48, 0, NullString, 0)
VeryStampClose(id)
End If
'//%.Grayscale Color (0-255 RGB color values supported) %
'//%.diagonal-top left and diagonal-bottom left. %
'//%·Stamp on Top of or Underneath the original PDF document page contents %
'//·Justification (when multi text)- Left, right, or center
id = VeryStampOpen(szPDFFile, "3.pdf")
If (id > 0) Then
code = VeryStampAddText(id, 5, "Page \p of \c", 0, 0, 0, 0, 0, 0, 0, 0, NullString, 10, 0, NullString, 0)
code = VeryStampAddText(id, 9, "www.verypdf.com\n Demo", RGB(200, 200, 200), 18, 0, 0, -45, 1, 0, 301, NullString, 48, 0, NullString, 0)
VeryStampClose(id)
End If
'//%·Supports Font Style, Font Size, Text Modes (solid, outline), Grayscale and RGB Color (0-255 RGB color values supported) %
'//%·Stamp on Underneath the original PDF document page contents %
'//%·Text and Image can be stamped on any angle. Any positive or negative numbers, including decimal numbers may be used to specify an angle in degrees %
id = VeryStampOpen(szPDFFile, "4.pdf")
If (id > 0) Then
code = VeryStampAddText(id, 9, "www.verypdf.com", RGB(200, 200, 200), 0, 0, 0, -20, 1, 1, 202, NullString, 60, 0, NullString, 0)
VeryStampClose(id)
End If
'//%·Stamps can be placed in the exact vertical center of a page (or the exact vertical center within a individual stamping space) %
id = VeryStampOpen(szPDFFile, "5.pdf")
If (id > 0) Then
code = VeryStampAddText(id, 9, "www.verypdf.com", RGB(255, 255, 0), 0, 0, 0, 0, 0, 0, 101, NullString, 48, 0, NullString, 0)
code = VeryStampAddText(id, 8, "www.verypdf.com", RGB(0, 255, 255), 0, 0, 0, 90, 0, 0, 0, NullString, 48, 0, NullString, 0)
code = VeryStampAddText(id, 4, "www.verypdf.com", RGB(0, 255, 255), 0, 0, 0, -90, 0, 0, 0, NullString, 48, 0, NullString, 0)
VeryStampClose(id)
End If
'//tridimensional effect
id = VeryStampOpen(szPDFFile, "6.pdf")
If (id > 0) Then
code = VeryStampAddText(id, 9, "www.verypdf.com", RGB(64, 64, 64), 0, 1, 1, 45, 0, 0, 0, NullString, 64, 0, NullString, 0)
code = VeryStampAddText(id, 9, "www.verypdf.com", RGB(255, 0, 0), 0, 0, 0, 45, 0, 0, 0, NullString, 64, 0, NullString, 0)
VeryStampClose(id)
End If
'//hollow tridimensional effect
id = VeryStampOpen(szPDFFile, "7.pdf")
If (id > 0) Then
code = VeryStampAddText(id, 9, "www.verypdf.com", RGB(64, 64, 64), 0, 1, 2, 45, 1, 1, 0, NullString, 64, 0, NullString, 0)
code = VeryStampAddText(id, 9, "www.verypdf.com", RGB(255, 0, 0), 0, 0, 0, 45, 0, 1, 0, NullString, 64, 0, NullString, 0)
VeryStampClose(id)
End If
'//%·Supports image stamp (JPEG/TIFF images) %
id = VeryStampOpen(szPDFFile, "8.pdf")
If (id > 0) Then
code = VeryStampAddImage(id, 7, "logo.jpg", 30, -30, 0, 0, 0, 0, 0, NullString, 0)
code = VeryStampAddImage(id, 3, "logo.jpg", -30, 30, 0, 0, 0, 0, 0, NullString, 0)
VeryStampClose(id)
End If
'//% image stamp %
'//%·vertical center.%
id = VeryStampOpen(szPDFFile, "9.pdf")
If (id > 0) Then
code = VeryStampAddImage(id, 4, "logo.jpg", -10, 0, 90, 0, 0, 0, 0, NullString, 0)
code = VeryStampAddImage(id, 8, "logo.jpg", 10, 0, -90, 0, 0, 0, 0, NullString, 0)
VeryStampClose(id)
End If
'//%· Wrap text to a new line if it would otherwise be too long to fit in its margined area%
id = VeryStampOpen(szPDFFile, "10.pdf")
If (id > 0) Then
code = VeryStampAddText(id, 9, "Wrap text to a new line if it would otherwise be too long to fit in its margined area.", 2666666, 16, 0, 0, 0, 1, 0, 0, NullString, 64, 0, NullString, 0)
VeryStampClose(id)
End If
'//%·Supports web links%
'//%·Enabling you to easily position the stamp in any location on the page %
id = VeryStampOpen(szPDFFile, "11.pdf")
If (id > 0) Then
code = VeryStampAddText(id, 2, "Supports web links", RGB(255, 11, 0), 0, -50, 200, 0, 1, 0, 0, NullString, 48, 1, "http:'//www.verypdf.com", 0)
code = VeryStampAddText(id, 4, "Enabling you to easily position the stamp\n in any location on the page", RGB(255, 11, 22), 17, -50, 200, 0, 0, 0, 0, NullString, 10, 1, "http:'//www.verypdf.com", 0)
VeryStampClose(id)
End If
'//%text rotate and position%
id = VeryStampOpen(szPDFFile, "12.pdf")
If (id > 0) Then
code = VeryStampAddText(id, 1, "verypdf.com Inc.", 65296, 0, 0, 0, -45, 0, 0, 0, NullString, 48, 0, NullString, 0)
code = VeryStampAddText(id, 3, "verypdf.com Inc.", 65296, 0, 0, 0, 45, 0, 0, 0, NullString, 48, 0, NullString, 0)
code = VeryStampAddText(id, 5, "verypdf.com Inc.", 65296, 0, 0, 0, -45, 0, 0, 0, NullString, 48, 0, NullString, 0)
code = VeryStampAddText(id, 7, "verypdf.com Inc.", 65296, 0, 0, 0, 45, 0, 0, 0, NullString, 48, 0, NullString, 0)
VeryStampClose(id)
End If
'//%image rotate and position%
id = VeryStampOpen(szPDFFile, "13.pdf")
If (id > 0) Then
code = VeryStampAddImage(id, 9, "logo.jpg", -70, -70, -45, 0, 0, 0, 0, NullString, 0)
code = VeryStampAddImage(id, 9, "logo.jpg", 70, -70, 225, 0, 0, 0, 0, NullString, 0)
code = VeryStampAddImage(id, 9, "logo.jpg", 70, 70, 135, 0, 0, 0, 0, NullString, 0)
code = VeryStampAddImage(id, 9, "logo.jpg", -70, 70, 45, 0, 0, 0, 0, NullString, 0)
VeryStampClose(id)
End If
id = VeryStampOpen(szPDFFile, "14.pdf")
If (id > 0) Then
code = VeryStampAddText(id, 7, "verypdf.com Inc.", 165296, 0, 0, -100, -45, 0, 0, 0, NullString, 48, 0, NullString, 0)
code = VeryStampAddText(id, 7, "verypdf.com Inc.", 1652962, 0, 50, -200, -45, 0, 0, 0, NullString, 48, 0, NullString, 0)
code = VeryStampAddText(id, 7, "verypdf.com Inc.", 16529621, 0, 100, -300, -45, 0, 0, 0, NullString, 48, 0, NullString, 0)
code = VeryStampAddText(id, 7, "verypdf.com Inc.", 165296210, 0, 150, -400, -45, 0, 0, 0, NullString, 48, 0, NullString, 0)
code = VeryStampAddText(id, 7, "verypdf.com Inc.", 165210, 0, 200, -500, -45, 0, 0, 0, NullString, 48, 0, NullString, 0)
VeryStampClose(id)
End If
'//%image zoom%
id = VeryStampOpen(szPDFFile, "15.pdf")
If (id > 0) Then
code = VeryStampAddImage(id, 2, "logo.jpg", 80, 200, -45, 1, 300, 300, 0, NullString, 0)
VeryStampClose(id)
End If
'//%·Supports line stamp %
id = VeryStampOpen(szPDFFile, "16.pdf")
If (id > 0) Then
code = VeryStampAddText(id, 7, "\d\n\t", 255, 0, 70, -50, 0, 0, 0, 0, NullString, 10, 0, NullString, 0)
code = VeryStampAddText(id, 5, "Page \p of \c ", 255, 0, -70, -50, 0, 0, 0, 0, NullString, 10, 0, NullString, 0)
code = VeryStampAddText(id, 3, "2003 verypdf.com Inc.", 255, 0, -60, 60, 0, 0, 0, 300, NullString, 10, 0, NullString, 0)
code = VeryStampAddLine(id, 2, 1, 0, 0, 80, 0, 0, 80, 0)
code = VeryStampAddLine(id, 6, 1, 0, 0, -80, 0, 0, 80, 0)
VeryStampClose(id)
End If
'//%·Supports links (web links, page link, open file, remote page link).%
id = VeryStampOpen(szPDFFile, "17.pdf")
If (id > 0) Then
code = VeryStampAddText(id, 2, "Supports web links", 255, 0, -50, 200, 15, 0, 0, 0, NullString, 32, 1, "http:'//www.verypdf.com", 0)
code = VeryStampAddText(id, 4, "Supports page links", 255, 0, -50, 200, 0, 0, 0, 0, NullString, 32, 2, NullString, 3)
code = VeryStampAddImage(id, 9, "logo.jpg", 0, 0, 15, 1, 0, 0, 3, "openlink.txt", 0)
VeryStampClose(id)
End If
'//%·Set which pages to stamp on by selecting a predefined range.%
'//% Every even page%
id = VeryStampOpen(szPDFFile, "18.pdf")
If (id > 0) Then
'//% Every even page%
code = VeryStampSetFunction(id, 131, -2, -2, 0, 0)
code = VeryStampAddText(id, 2, "Set which pages to stamp on by selecting a predefined range.", 2666666, 17, 0, 200, 0, 0, 0, 0, NullString, 32, 0, NullString, 0)
VeryStampClose(id)
End If
End Sub