Spliting and Merging
Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: I need help - I can help
Forum Description: Problems and solutions while programming with the Debenu Quick PDF Library and Debenu PDF Viewer SDK
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=1364
Printed Date: 13 Jun 25 at 4:24PM Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com
Topic: Spliting and Merging
Posted By: pn_patel2002
Subject: Spliting and Merging
Date Posted: 09 Mar 10 at 9:48AM
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.
Original file details: Size=3.50MB, Pages:80 Extract/split Obeservation: process time: 2 sec, size of all 80 files=5.02MB Merge Obeservation: Process Time:1 Sec, Size =8.63MB
Private sub Extract()
Dim qp As New QuickPDFAX0718.PDFLibrary qp.UnlockKey(licenseKey) If qp.Unlocked = 1 Then Dim f As New OpenFileDialog f.Filter = "PDF Files|*.pdf" If f.ShowDialog = Windows.Forms.DialogResult.OK Then qp.LoadFromFile(f.FileName) For i As Int32 = 1 To qp.PageCount
If qp.ExtractPages(i, 1) = 1 Then qp.SaveToFile(Application.StartupPath & "\Extracted\Extract_Sample" & i.ToString & ".pdf") End If qp.LoadFromFile(f.FileName) Next End If MsgBox("done") End If end sub
Private sub Merge()
Dim qp As New QuickPDFAX0718.PDFLibrary qp.UnlockKey(licenseKey) If qp.Unlocked = 1 Then Dim d As New DirectoryInfo(Application.StartupPath & "\Extracted") Dim f() As FileInfo f = d.GetFiles() Dim outputfilename As String outputfilename = f(0).FullName For i As Int32 = 1 To f.Count - 1 qp.MergeFiles(outputfilename, f(i).FullName, Application.StartupPath & "\Merge\test" & i & ".pdf") Application.DoEvents() outputfilename = Application.StartupPath & "\Merge\test" & i & ".pdf" Next MsgBox("Done") End If
end sub 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?
Pranav
|
Replies:
Posted By: Ingo
Date Posted: 09 Mar 10 at 11:59AM
Hi Pranav!
1. There are more than one solution. If it works then it's okay ;-) 2. There are many attributes (the used font for example) in a document. If you make 80 documents out of one then these attributes will be in each (80!) document. After the final merge these attributes will be multiple senseless in the new document. 3. QuickPDF offers functions to compress fonts and images. There are functions to strip the single documents before the merge (remove the fonts for example).
Have a look in the "general section"... I've inserted a post "the first steps...".
Cheers and welcome here, Ingo
|
|