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!
![]() |
How to make duplicate pages without any reference? |
Post Reply
|
| Author | |
ExchangeViews
Team Player
Joined: 13 Mar 12 Status: Offline Points: 38 |
Post Options
Thanks(0)
Quote Reply
Topic: How to make duplicate pages without any reference?Posted: 22 May 13 at 9:25AM |
|
Hi all, I have a pdf of 5 pages - 1,2,3,4,5. I want to make each page repeated like this - 1,1,2,2,3,3,4,4,5,5. I used CopyPageRangesEx(id,'1,1,2,2,3,3,4,4,5,5',1) and created a new pdf with duplicate pages. Now if I capture first page using CapturePageEx(I, 1), it makes the second page blank. What i want to capture the first page only without making second page blank. what function I need to use to make duplicate page content visible after previuos page capture?
ids:=QP.NewDocument; QP.LoadFromFile(EditFileName.Text,''); id:= QP.SelectedDocument; QP.SelectDocument(ids); QP.CopyPageRangesEx(id,'1,1,2,2,3,3,4,4,5,5',1); QP.DeletePages(1,1); QP.SelectPage(1); QP.SetOrigin(1); QP.SetCropBox(0, 0, QP.PageWidth/2, QP.PageHeight) pid := QP.CapturePageEx(I, 1); QP.InsertPages(1,1); QP.SetPageSize('A4'); QP.DrawCapturedPage(pid, 0, 0, QP.PageWidth, QP.PageHeight); Thanks in advance. ![]() |
|
![]() |
|
AndrewC
Moderator Group
Joined: 08 Dec 10 Location: Geelong, Aust Status: Offline Points: 841 |
Post Options
Thanks(0)
Quote Reply
Posted: 23 May 13 at 5:13AM |
|
Hello, Without testing, I suspect pages 1 and 2 (copy of page 1) share the same content stream so if you Capture the contentstream of page 1 then it also affects pages 2. RemoveSharedContentStreams should fix this.
QP.LoadFromFile("5pages.pdf", ""); int id = QP.SelectedDocument(); QP.NewDocument(); int ret = QP.CopyPageRangesEx(id,"1,1,2,2,3,3,4,4,5,5",1) ; QP.RemoveSharedContentStreams(); QP.DeletePages(1, 1); // Remove the empty first page. int capID = QP.CapturePage(1); // Copies and then deletes page 1 QP.NewPage(); // Add a new page at the end of the document QP.SetOrigin(1); QP.DrawCapturedPage(capID, 0, 0, QP.PageWidth() * 2, QP.PageHeight() * 4); QP.SaveToFile("out.pdf"); Andrew. |
|
![]() |
|
ExchangeViews
Team Player
Joined: 13 Mar 12 Status: Offline Points: 38 |
Post Options
Thanks(0)
Quote Reply
Posted: 23 May 13 at 9:22AM |
|
Hi AndrewC,
Great, it worked. Thanks again.
![]() |
|
![]() |
|
Post Reply
|
|
|
Tweet
|
| Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |
Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. About — Contact — Blog — Support — Online Store