Here's the code
- Code: Select all
oImaging = CreateObject("gdpicturepro5.Imaging")
oGdViewer = CreateObject("gdpicturepro5.GdViewer")
oImaging.SetLicenseNumber("xxxxx")
oGDViewer.SetLicenseNumber("xxxxx")
oGdViewer.LockControl = .t.
oGdViewer.DisplayFromPdfFile("c:\input.pdf")
For nPage = 1 TO oGdViewer.PageCount
oGdViewer.DisplayFrame(nPage)
If nPage = 1 Then
oImaging.SetNativeImage (oImaging.CreateClonedImage(oGdViewer.GetNativeImage))
oImaging.TiffSaveAsNativeMultiPage("c:\output.tif")
Else
oImaging.TiffAddToNativeMultipage(oGdViewer.GetNativeImage)
EndIf
Next nPage
oImaging.TiffCloseNativeMultiPage
This works fine...I can then do whatever I need to do with the image before saving it back as a PDF as follows:
- Code: Select all
oImaging = CreateObject("gdpicturepro5.Imaging")
oGdViewer = CreateObject("gdpicturepro5.GdViewer")
oImaging.SetLicenseNumber("xxxxx")
oGDViewer.SetLicenseNumber("xxxxx")
oTiffImage = oImaging.CreateImageFromFile("c:\output.tif")
nStatus = oImaging.PdfCreateFromMultipageTIFF(oTiffImage,"c:\output.pdf")
The problem is....the original PDF was 23k in size....my resulting PDF (even without any changes) is 250k in size.
Is there a better way of doing this?
