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!
Using(twice) DrawRotatedCapturedPage on a new Page |
Post Reply |
Author | |
JMLM
Team Player Joined: 26 Mar 13 Status: Offline Points: 40 |
Post Options
Thanks(0)
Posted: 06 Jul 14 at 3:22PM |
Hello,
I'd like to copy a page and duplicate it on a new page, after rotate and resize each new copy How DrawRotatedCapturedPage and CapturePage can be used ? I tried thes lines of code, with no success (I thought to use these function this way) for (int i = 1; i <= qp.PageCount(); i++) { qp.SelectPage(i); int CapturedPageID = qp.CapturePage(i); int newPage = qp.NewPage(); qp.SelectPage(newPage); qp.DrawRotatedCapturedPage(CapturedPageID,0 , 0, NewWidth, NewHeight, 90); qp.DrawRotatedCapturedPage(CapturedPageID, 0, newPos, NewWidth, NewHeight, 90); } NewHeight = iPageWidth; I have a function for NewWidth = getNewWidth(iPageHeight,iPageWidth,NewHeight ); private double getNewWidth(double imgH, double imgW, double newImgH) { double result = (imgW / imgH * newImgH); return result; } I have an error, and my captures are not displayed correctly. The angle 90 is not respected, I have 180 sometimes. cheers, Edited by JMLM - 07 Jul 14 at 7:22AM |
|
AndrewC
Moderator Group Joined: 08 Dec 10 Location: Geelong, Aust Status: Offline Points: 841 |
Post Options
Thanks(0)
|
JMLM,
Can you try the following variation of the code. Andrew. for (int i = 1; i <= qp.PageCount(); i++) int newPage = qp.NewPage(); // For 1 page documents we need a 2nd page before calling CapturePage.{ qp.SelectPage(1); // Each capture deletes the page so always capture page 1. qp.NormalizePage(0); // Remove rotation and shared content streams. int CapturedPageID = qp.CapturePage(1); // Again page 1. qp.SelectPage(newPage); qp.DrawRotatedCapturedPage(CapturedPageID,0 , 0, NewWidth, NewHeight, 90); qp.DrawRotatedCapturedPage(CapturedPageID, 0, newPos, NewWidth, NewHeight, 90); } Andrew.
Edited by AndrewC - 08 Jul 14 at 11:59AM |
|
JMLM
Team Player Joined: 26 Mar 13 Status: Offline Points: 40 |
Post Options
Thanks(0)
|
Hello Andrew,
Thanks for your reply, Using your code, I still have an error (tree nodes document), on opening the file with adobe reader, and all the qp.DrawRotatedCapturedPage are overlapped on the first page of the document , with an angle of 90 to each page, and the rest of pages are blank. The result is the same with xcode version, and C# version. Cheers. Jim
Edited by JMLM - 10 Jul 14 at 9:12AM |
|
JMLM
Team Player Joined: 26 Mar 13 Status: Offline Points: 40 |
Post Options
Thanks(0)
|
Hello finaly ,
those lines of codes did the job (objective-c version) : for (int i = 1; i <= [DQPL PageCount]; i++) {
[DQPL NormalizePage:0]; int CapturedPageID = [DQPL CapturePage:1]; // Again page 1. int newPage = [DQPL NewPage]; [DQPL SelectPage:newPage];
[DQPL DrawRotatedCapturedPage: CapturedPageID:500 :0 : 500 : 500: 90]; [DQPL DrawRotatedCapturedPage: CapturedPageID:500 :500 : 500 : 500: 90];
} Edited by JMLM - 11 Sep 14 at 4:54PM |
|
JMLM
Team Player Joined: 26 Mar 13 Status: Offline Points: 40 |
Post Options
Thanks(0)
|
I still have a warning on opening the file "The tree node contains an incorrect page." (when Bookmarks exist in the current file)
even if I remove the bookmarks with this line of code : int test = [DQPL GetFirstOutline]; [DQPL RemoveOutline:test]; How can I avoid this warning ? Cheers Jim |
|
AndrewC
Moderator Group Joined: 08 Dec 10 Location: Geelong, Aust Status: Offline Points: 841 |
Post Options
Thanks(0)
|
JMLM,
It sounds like you have more book marks that needs to be delete. You seem to be only deleting the first bookmark. Can you upload the PDF or send it to support@debenu.com so we can see what the problem is and how to fix it. There could be other issues also. Andrew.
|
|
JMLM
Team Player Joined: 26 Mar 13 Status: Offline Points: 40 |
Post Options
Thanks(0)
|
Hello Andrew,
Bookmarks are the problem, I need to list them, and delete them, for the moment , and save the file as a new file. I use the Debenu Reference Guide PDF, for testing. Thanks for your reply. Cheers To delete Outlines : int firstOutline = [DQPL GetFirstOutline]; int current = firstOutline;
while ([DQPL GetNextOutline:current] != 0) { int next = [DQPL GetNextOutline:current]; [DQPL RemoveOutline:current]; current = next; } firstOutline = [DQPL GetFirstOutline];
[DQPL RemoveOutline:firstOutline]; Edited by JMLM - 20 Aug 14 at 4:12PM |
|
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