Page 1 of 1

Save resize image

Posted: Mon Sep 24, 2012 3:53 pm
by bpabmeyer
I am trying to save a scanned image to PDF. The scanned image is full size letter/legal. I need to save the image resizing it to leave a 2 inch margin on top or bottom. Is this possible? If so, how do I accomplish it. Attached is what I have for the current processing.


Dim file As File = Nothing
Dim imageID As Integer

If GdPictureImaging.TwainOpenSource(Me.Handle, lblScannerName.Text) Then
InitScanConfig()

imageID = GdPictureImaging.TwainAcquireToGdPictureImage(Me.Handle)
ScanRecord = imageID
GdPicturePDF.NewPDF()
If imageID <> 0 Then
GdPicturePDF.AddImageFromGdPictureImage(imageID, False, True)
GdViewer1.ZoomMode = ViewerZoomMode.ZoomModeFitToViewer
GdViewer1.DisplayFromGdPictureImage(imageID)
End If
Else
ScanRecord = 0
End If
GdPicturePDF.SaveToFile(strDocumentPath & Year(Now()) & "\" & lblFirmNumber.Text & ".pdf")

Re: Save resize image

Posted: Thu Jan 31, 2019 4:11 pm
by Gabriela
Hi,

Use AddImageFromGdPictureImage() method with the DrawImage parameter set to false:
http://guides.gdpicture.com/content/web ... lean).html
And then draw that image with the required size using DrawImage() method:
http://guides.gdpicture.com/content/web ... Image.html