Print Page | Close Window

VB6 code for using CopyPageRanges function

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: Sample Code
Forum Description: Share Debenu Quick PDF Library sample code with other forum members
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=1219
Printed Date: 22 Nov 24 at 7:01PM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: VB6 code for using CopyPageRanges function
Posted By: Rowan
Subject: VB6 code for using CopyPageRanges function
Date Posted: 20 Sep 09 at 11:27AM
Small snippet of VB6 code for using CopyPageRanges function:

---------------------------
Private Sub btnCopyPageRanges_Click() Dim ClassName Dim LicenseKey Dim FileName ClassName = "QuickPDFAX0716.PDFLibrary" LicenseKey = "..." 'SET YOUR LICENSE KEY HERE... FileName = "C:\Program Files\Quick PDF Library\Quick PDF Library 7.16 Reference Guide.pdf" Dim QP Dim Result Dim FromDocumentID Dim ToDocumentID Set QP = CreateObject(ClassName) Result = QP.UnlockKey(LicenseKey) If Result = 1 Then ' Load file to copy pages from Call QP.LoadFromFile(FileName) ' Get document ID of loaded file FromDocumentID = QP.SelectedDocument() ' Create new document to copy pages to and get document id ToDocumentID = QP.NewDocument() ' Select document to copy pages to Call QP.SelectDocument(ToDocumentID) ' Copy pages from the first document to the second document (which has already been selected) Call QP.CopyPageRanges(FromDocumentID, "10,15,18-20,25-35") ' Delete the first page in the new document as it is a blank page Call QP.DeletePages(1, 1) ' Save the (already selected) new document to disk Call QP.SaveToFile("C:\PagesCopied.pdf") Else MsgBox "Invalid license key. Please set your license key by editing this file." End If End Sub
---------------------------



Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.01 - http://www.webwizforums.com
Copyright ©2001-2014 Web Wiz Ltd. - http://www.webwiz.co.uk