Do you own a Debenu Quick PDF Library version 7, 8, 9, 10, 11, 12, 13 or iSEDQuickPDF license? Upgrade to Debenu Quick PDF Library 14 today!

Debenu Quick PDF Library - PDF SDK Community Forum Homepage
Forum Home Forum Home > For Users of the Library > I need help - I can help
  New Posts New Posts RSS Feed - Spliting and Merging
  FAQ FAQ  Forum Search   Register Register  Login Login

Spliting and Merging

 Post Reply Post Reply
Author
Message
pn_patel2002 View Drop Down
Beginner
Beginner


Joined: 09 Mar 10
Status: Offline
Points: 1
Post Options Post Options   Thanks (0) Thanks(0)   Quote pn_patel2002 Quote  Post ReplyReply Direct Link To This Post Topic: Spliting and Merging
    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
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3529
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post 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

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.01
Copyright ©2001-2014 Web Wiz Ltd.

Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. AboutContactBlogSupportOnline Store