I have tried MergeDocument, Merge2Document of GDPicturePDF class. but every time it is throwing error.
"this object doesn't support this property and method".
Kindly help me for megring pdfs using GDPicturePDF class in vb6.0
regards
Deepti
I need code for merging PDFs in VB6.0
Re: I need code for merging PDFs in VB6.0
Here is a snippet to merge 2 PDF with VB6 :
I hope this helps.
Cheers,
Cedric
Code: Select all
Private Sub Command1_Click()
Dim status As GdPictureStatus
Dim oGdPicturePDF As New GdPicturePDF
status = oGdPicturePDF.Merge2Documents("c:\test1.pdf", "c:\test2.pdf", "c:\Result.pdf")
If status = GdPictureStatus.GdPictureStatus_OK Then
MsgBox ("success")
Else
MsgBox ("failure. Status: " + CStr(status))
End If
End Sub
Cheers,
Cedric
Re: I need code for merging PDFs in VB6.0
Actually, i am using the same code but it is working for first time. i have 10 pdfs in a folder and i am trying ti run the same code in loop. but in second or third iteration it is failing. it is giving status as 1 (Generic error).
Set FSfolder = fso.GetFolder("C:\GDPictureOutput")
For Each File In FSfolder.Files
DoEvents
status = OutPdf.Merge2Documents("C:\OutputResult.pdf", File, "C:\TempResult.pdf")
If status = GdPictureStatus.GdPictureStatus_OK Then
fso.CopyFile "C:\TempResult.pdf", "C:\OutputResult.pdf", True
fso.DeleteFile "C:\TempResult.pdf", True
pageProcessedLabel.Caption = "File " & File.Name
Else
MsgBox ("failure. Status: " + status)
End If
Next File
Regards
Deepti
Set FSfolder = fso.GetFolder("C:\GDPictureOutput")
For Each File In FSfolder.Files
DoEvents
status = OutPdf.Merge2Documents("C:\OutputResult.pdf", File, "C:\TempResult.pdf")
If status = GdPictureStatus.GdPictureStatus_OK Then
fso.CopyFile "C:\TempResult.pdf", "C:\OutputResult.pdf", True
fso.DeleteFile "C:\TempResult.pdf", True
pageProcessedLabel.Caption = "File " & File.Name
Else
MsgBox ("failure. Status: " + status)
End If
Next File
Regards
Deepti
Who is online
Users browsing this forum: No registered users and 2 guests