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 - How to make duplicate pages without any reference?
  FAQ FAQ  Forum Search   Register Register  Login Login

How to make duplicate pages without any reference?

 Post Reply Post Reply
Author
Message
ExchangeViews View Drop Down
Team Player
Team Player
Avatar

Joined: 13 Mar 12
Status: Offline
Points: 38
Post Options Post Options   Thanks (0) Thanks(0)   Quote ExchangeViews Quote  Post ReplyReply Direct Link To This Post 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.Clap


Back to Top
AndrewC View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 08 Dec 10
Location: Geelong, Aust
Status: Offline
Points: 841
Post Options Post Options   Thanks (0) Thanks(0)   Quote AndrewC Quote  Post ReplyReply Direct Link To This Post Posted: 23 May 13 at 5:13AM
Hello,

You  should maybe try calling QP.RemoveSharedContentStreams after calling CopyPageRangesEx.

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.
Back to Top
ExchangeViews View Drop Down
Team Player
Team Player
Avatar

Joined: 13 Mar 12
Status: Offline
Points: 38
Post Options Post Options   Thanks (0) Thanks(0)   Quote ExchangeViews Quote  Post ReplyReply Direct Link To This Post Posted: 23 May 13 at 9:22AM
Hi AndrewC,

Great, it worked. Thanks again.Thumbs Up
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