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 > Sample Code
  New Posts New Posts RSS Feed - Adding pages
  FAQ FAQ  Forum Search   Register Register  Login Login

Adding pages

 Post Reply Post Reply
Author
Message
einar View Drop Down
Beginner
Beginner
Avatar

Joined: 18 Mar 10
Location: Norway
Status: Offline
Points: 11
Post Options Post Options   Thanks (0) Thanks(0)   Quote einar Quote  Post ReplyReply Direct Link To This Post Topic: Adding pages
    Posted: 18 Mar 10 at 12:38PM
After using much time trying to use ClonePages() and CapturePage()/DrawCapturedPage() without luck, I found that using MergeDocument() did what I needed. So I like to add this function to this forum. The code is in Foxpro.
 
The task is to create a letter using a template with two pages. (The template is created with MS-Word) One page with header/footer for the first page and one page as a template for rest of the pages. The idea is to add template page 2 as many times as needed.
 
Function NewPage(N) && N is template page 1 or 2.
 Local nLast, nDoc2
 With This
  If N==1
   result=.oPDF.LoadFromFile(.templatefile)
   This.DocId=.oPDF.SelectedDocument()
   nLast=This.oPDF.PageCount()
   .oPDF.DeletePages(2,nLast-1)
  Else
   result=.oPDF.LoadFromFile(.templatefile)
   nDoc2=.oPDF.SelectedDocument()
   .oPDF.DeletePages(1,1)
   .oPDF.SelectDocument(.DocId)
   .oPDF.MergeDocument(nDoc2)
  Endif
  nLast=This.oPDF.PageCount()
  .oPDF.SelectPage(nLast)
  Return result
 Endwith
 Endfunc
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