I need code for merging PDFs in VB6.0

Example requests & Code samples for GdPicture Toolkits.
Post Reply
dsharma
Posts: 2
Joined: Fri Nov 30, 2012 9:57 am

I need code for merging PDFs in VB6.0

Post by dsharma » Fri Nov 30, 2012 10:00 am

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

Cedric
Posts: 269
Joined: Sun Sep 02, 2012 7:30 pm

Re: I need code for merging PDFs in VB6.0

Post by Cedric » Fri Nov 30, 2012 5:16 pm

Here is a snippet to merge 2 PDF with VB6 :

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
I hope this helps.

Cheers,
Cedric

dsharma
Posts: 2
Joined: Fri Nov 30, 2012 9:57 am

Re: I need code for merging PDFs in VB6.0

Post by dsharma » Sun Dec 02, 2012 7:30 pm

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

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests