You are here: GdPicture.NET > Documentation > Classes > GdPictureImaging Class > GdPictureImaging Methods > PDF Creation > TWAIN Acquisition To PDF & PDF/A > TwainAddGdPictureImageToPdf Method
logo.gif
ContentsIndexHome
PreviousUpNext
GdPictureImaging.TwainAddGdPictureImageToPdf Method

Appends a GdPicture Image into a multipage PDF file created by the TwainPdfStart()or the TwainPdfStartStream() function.

C#
public GdPictureStatus TwainAddGdPictureImageToPdf(
    int PdfID, 
    int ImageID
);
Visual Basic
Public Function TwainAddGdPictureImageToPdf(
    ByVal PdfID As Integer, 
    ByVal ImageID As Integer
) As GdPictureStatus
Parameters
Parameters 
Description 
PdfID 
A PDF identifier returned by the TwainPdfStart() or the TwainPdfStartStream() function.  
ImageID 
The GdPicture Image to add to the multipage PDF.  
Returns

A member of the GdPictureStatus enumeration.

How to scan pages of a document feeder to a multipage PDF/A file.

Dim oGdPictureImaging As New GdPictureImaging
Dim ImageID As Integer
Dim bContinue As Boolean = True
Dim PdfID As Integer
 
oGdPictureImaging.SetLicenseNumber("XXX") 'Replace XXX by a demo or commercial license key
 
 
oGdPictureImaging.TwainOpenDefaultSource(Me.Handle)
oGdPictureImaging.TwainSetAutoFeed(True)
oGdPictureImaging.TwainSetAutoScan(True)
 
PdfID = oGdPictureImaging.TwainPdfStart("output.pdf", True, "", "", "", "", "")
If PdfID <> 0 Then
   While bContinue
         ImageID = oGdPictureImaging.TwainAcquireToGdPictureImage(Me.Handle)
         oGdPictureImaging.TwainAddGdPictureImageToPdf(PdfID, ImageID)
         oGdPictureImaging.ReleaseGdPictureImage(ImageID)
         bContinue = (oGdPictureImaging.TwainGetState > TwainStatus.TWAIN_SOURCE_ENABLED)
   End While
   oGdPictureImaging.TwainPdfStop(PdfID)
End If
oGdPictureImaging.TwainCloseSource()
What do you think about this topic? Send feedback!
Copyright (c) 2009-2011 www.gdpicture.com. All rights reserved.