Hi,
I am trying to Split one multipage Pdf file into single pages and merge that splited pdfs' to a single PDF file using following methods. I am using the latest version.
Original file details: Size=3.50MB, Pages:80 (Pl. find attachment)
Extract/split Obeservation: process time: 2 sec, size of all 80 files=5.02MB
Merge Obeservation: Process Time:1 Sec, Size =8.63MB
Need assitance on:
1. Is it correct method for split/Merge?
2. If extracted pages total size is 5.02MB then why merged pdf file size increased?
3. How can I reproduce file after extracting to nearby its original size?
private sub ExtractPages()
Dim f As New OpenFileDialog
f.Filter = "PDF Files|*.pdf"
If f.ShowDialog = Windows.Forms.DialogResult.OK Then
'Label6.Text = Now
'Label6.Update()
'Dim fl As New FileInfo(f.FileName)
'Label20.Text = Math.Round(fl.Length / 1024, 3)
'Label20.Update()
v.Load(f.FileName, "")
For i As Int32 = 1 To v.pageCount
v.extractPagesToFile(Application.StartupPath & "\Extracted\Extract_Sample" & i.ToString & ".pdf", i)
''v.Save(Application.StartupPath & "\Extract_Sample" & i.ToString & ".pdf")
Next
'Label5.Text = Now
'Label5.Update()
'Label4.Text = DateDiff(DateInterval.Second, CType(Label6.Text, Date), CType(Label5.Text, Date))
''
MsgBox("Done")
End If
end sub
private sub MergePages()
Dim d As New DirectoryInfo(Application.StartupPath & "\Extracted")
Dim f() As FileInfo
f = d.GetFiles()
For i As Int32 = 0 To f.Count - 1
v.insertPagesFromPDF(f(i).FullName, "", 1, VSPDFEditorX.TxVSPDFInsertPagesPosition.VSPDF_INSERTPAGES_AFTER_CURRENTPAGE)
Next
v.Save(Application.StartupPath & "\Merge\test.pdf")
' Label8.Text = Now
' Label8.Update()
' Label7.Text = DateDiff(DateInterval.Second, CType(Label9.Text, Date), CType(Label8.Text, Date))
' Dim fl As New FileInfo(Application.StartupPath & "\Merge\test.pdf")
'Label19.Text = Math.Round(fl.Length / 1024, 3)
'Label19.Update()
MsgBox("done")
end sub
Thanks n Rgds
Charu
