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 - split large PDF file
  FAQ FAQ  Forum Search   Register Register  Login Login

split large PDF file

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


Joined: 13 Apr 15
Status: Offline
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote DrCizor Quote  Post ReplyReply Direct Link To This Post Topic: split large PDF file
    Posted: 13 Apr 15 at 1:54PM
hi everyone,

I am working with Delphi and wish to quickly split a PDF file into several other files.

I have a PDF source file containing a minimum of 5000 pages and a table describing how to group the documents.
Ths table contains the informations :
- Document name (string)
- First page of the document, from the begining ( Integer)
- Number of pages ( Integer)

The number of pages per document varies from 1 to 12.

What I want to output is 12 files each containing all the documents with the same number of pages :
-> one file with all the "one page"
-> one file with all the "two pages"
-> one file with all the "three page"
etc...
-> and one file with all the "twelve pages".

How to proceed with QuickPDF to get prompt treatment and which methods to use ?

Thank you


Back to Top
mLipok View Drop Down
Senior Member
Senior Member
Avatar

Joined: 23 Apr 14
Location: Poland, Zabrze
Status: Offline
Points: 449
Post Options Post Options   Thanks (0) Thanks(0)   Quote mLipok Quote  Post ReplyReply Direct Link To This Post Posted: 16 Apr 15 at 3:16PM
@DrCizor
First what You need is to use
http://www.debenu.com/docs/pdf_library_reference/ExtractFilePages.php
or
http://www.debenu.com/docs/pdf_library_reference/ExtractFilePagesEx.php


ps.
I'am using AutoIt (this  is similar to VBScript)

and here you have some concept how to split file in separate page

Func _QPDF_FileSplitEachPage($sPDF_FileFullPath, $sPDF_Password = '', $sDestinationDir = Default, $iNumberOfDigits = 3)
    If $sDestinationDir = Default Then $sDestinationDir = @ScriptDir & '\Extracted'
    Local $oQP
    If _QPDF_CreateObjectAndUnlock($oQP) = 1 Then
        $oQP.LoadFromFile($sPDF_FileFullPath, $sPDF_Password)
        ; _QPDF_LastErrorCode($oQP)
        Local $iTotalPages = _QPDF_FileGetPageCount($sPDF_FileFullPath, '')
        Local $sPDF_Destination = ''
        If Not FileExists($sDestinationDir) Then DirCreate($sDestinationDir)
        Local $aPageFileList[$iTotalPages + 1]
        $aPageFileList[0] = $iTotalPages

        For $n = 1 To $iTotalPages
            $sPDF_Destination = $sDestinationDir & '\' & StringRegExp($sPDF_FileFullPath, '(?i).*\\(.*?)\.pdf', 3)[0] & '_p' & __QPDF_AddLeadingZeros(String($n), $iNumberOfDigits) & ".pdf"
            $aPageFileList[$n] = $sPDF_Destination
            $oQP.ExtractFilePages($sPDF_FileFullPath, '', $sPDF_Destination, $n)
        Next
        Return SetError(0, 0, $aPageFileList)

    Else
        Return SetError($__eQPDF_ERROR_DEBENULICENCE, 0, 0)

    EndIf
EndFunc   ;==>_QPDF_FileSplitEachPage


Then you can use your TABLE and use 
http://www.debenu.com/docs/pdf_library_reference/AddToFileList.php
http://www.debenu.com/docs/pdf_library_reference/FileListCount.php
http://www.debenu.com/docs/pdf_library_reference/ClearFileList.php

and finally
http://www.debenu.com/docs/pdf_library_reference/MergeFileList.php
http://www.debenu.com/docs/pdf_library_reference/MergeFileListFast.php

or
http://www.debenu.com/docs/pdf_library_reference/MergeFiles.php


Regards,
mLipok

Here you can find description how to test my examples:
http://www.quickpdf.org/forum/forum_posts.asp?TID=2932&PID=12600&title=drawcapturedpagematrix-matrix-howto#12600
Back to Top
DrCizor View Drop Down
Beginner
Beginner


Joined: 13 Apr 15
Status: Offline
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote DrCizor Quote  Post ReplyReply Direct Link To This Post Posted: 23 Apr 15 at 2:16AM
Thank you mLipok,
I adapted your code in Delphi language and it works well !

Merci
Back to Top
mLipok View Drop Down
Senior Member
Senior Member
Avatar

Joined: 23 Apr 14
Location: Poland, Zabrze
Status: Offline
Points: 449
Post Options Post Options   Thanks (0) Thanks(0)   Quote mLipok Quote  Post ReplyReply Direct Link To This Post Posted: 23 Apr 15 at 7:36AM
Do it mean my coding style is transparent and clear (at least for you) ?
Here you can find description how to test my examples:
http://www.quickpdf.org/forum/forum_posts.asp?TID=2932&PID=12600&title=drawcapturedpagematrix-matrix-howto#12600
Back to Top
mLipok View Drop Down
Senior Member
Senior Member
Avatar

Joined: 23 Apr 14
Location: Poland, Zabrze
Status: Offline
Points: 449
Post Options Post Options   Thanks (0) Thanks(0)   Quote mLipok Quote  Post ReplyReply Direct Link To This Post Posted: 23 Apr 15 at 7:38AM
btw.
Can you share here your Delphi solution ?
I would also learn something.

Cheers,
mLipok

Here you can find description how to test my examples:
http://www.quickpdf.org/forum/forum_posts.asp?TID=2932&PID=12600&title=drawcapturedpagematrix-matrix-howto#12600
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