PM > Install-Package XDoc.PDF

How to Start Convert PDF Work with PDF Modules PDF Document PDF Pages Text Image Graph & Path Annotation, Markup & Drawing Redaction Security Digital Signature Forms Watermark Bookmark Link File Attachment File Metadata Printing Work with Other SDKs Barcode read Barcode create OCR Twain

VB.NET PDF Image Library
Copy, Paste, Cut PDF Image in VB.NET


VB.NET Tutorial for How to Cut or Copy an Image from One Page and Paste to Another in VB.NET









  • .NET framework PDF editor SDK control for image copying, pasting and cutting from adobe PDF file in VB.NET
  • Supported image formats, including Jpeg or Jpg, Png, Gif, Bmp, Tiff and other bitmap images
  • For C# tutorial, view details at how to copy, paste PDF images in C# code
  • Help to copy, paste and cut vector image, graphic picture, digital photo, scanned signature, logo, etc
  • Support .NET WinForms, ASP.NET MVC in IIS, ASP.NET Ajax, Azure cloud service, DNN (DotNetNuke), SharePoint
  • High quality image can be saved after cutting, copying and pasting into PDF page
  • Empower to cut, copy and paste a single image, multiple images and whole PDF document images
  • Allow to copy an image from existing PDF file and paste it into another one
  • Guarantee high performance image processing by implementing coordinates to locate image position accurately
  • Copy, paste and cut PDF image while preview without adobe reader component installed
  • Image resize function allows VB.NET users to zoom and crop image
  • Free Visual Studio .NET PDF library, easy to be integrated in .NET WinForms and ASP.NET
  • Online source codes for quick evaluation in VB.NET class program


Besides image extracting, adding, and removing, RasterEdge XDoc.PDF for .NET also supports image copying, pasting, and cutting. VB programming features of this PDF image processing control are similar to C#, more details are listed below.



asp.net remove text from pdf online, asp.net pdf reader, asp.net show image from byte array, how to write pdf file in asp.net c#, asp net mvc show pdf in div, asp net view word document in browser, asp.net core pdf preview.





VB.NET copy an image from a pdf file and paste to another position


This C#.NET example describes how to copy an image from one page of PDF document and paste it into another page.



Dim inputFilePath As String = "C:\2.pdf"
Dim outputFilePath As String = "C:\output.pdf"

Dim doc As PDFDocument = New PDFDocument(inputFilePath)

' get the first page
Dim pageIndex As Integer = 0
Dim page1 As PDFPage = doc.GetPage(pageIndex)

' select image at the position (480F, 550F) in the page
Dim cursorPos As PointF = New PointF(480.0F, 550.0F)
Dim image As PDFImage = PDFImageHandler.SelectImage(page1, cursorPos)

' copy the image
Dim anImage As Bitmap = image.Image.Clone()

' get the second page
Dim page2 As PDFPage = doc.GetPage(1)
' set image position in the page: x = 100.0F, Y = 400F
Dim position As PointF = New PointF(100.0F, 400.0F)

' add image to the page
PDFImageHandler.AddImage(page2, anImage, position)

' output the New document
doc.Save(outputFilePath)




VB.NET move an image in the PDF page


Dim inputFilePath As String = "C:\2.pdf"
Dim outputFilePath As String = "C:\output.pdf"

' open a document and select the page
Dim doc As PDFDocument = New PDFDocument(inputFilePath)
Dim page As PDFPage = doc.GetPage(0)
' extract all images in the page
Dim images As List(Of PDFImage) = PDFImageHandler.ExtractImages(page)
' move the first image to position (0, 0) in the same page
PDFImageHandler.MoveImageTo(doc, images(0), New PointF(0F, 0F))

' output the new document
doc.Save(outputFilePath)




VB.NET replace an image in the document


Dim inputFilePath As String = "C:\1.pdf"
Dim outputFilePath As String = "C:\output.pdf"
Dim bitmap As Bitmap = New Bitmap("C:\1.png")

' Open file and get the first page
Dim doc As PDFDocument = New PDFDocument(inputFilePath)
Dim page As PDFPage = doc.GetPage(0)

' Select the image at position (70, 80).
Dim img As PDFImage = PDFImageHandler.SelectImage(page, New PointF(70, 80))

' Replace the selected image by the New image.
PDFImageHandler.ReplaceImage(page, img, bitmap)

doc.Save(outputFilePath)