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 - Using(twice) DrawRotatedCapturedPage on a new Page
  FAQ FAQ  Forum Search   Register Register  Login Login

Using(twice) DrawRotatedCapturedPage on a new Page

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

Joined: 26 Mar 13
Status: Offline
Points: 40
Post Options Post Options   Thanks (0) Thanks(0)   Quote JMLM Quote  Post ReplyReply Direct Link To This Post Topic: Using(twice) DrawRotatedCapturedPage on a new Page
    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
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: 08 Jul 14 at 11:58AM
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, 
NewWidthNewHeight, 90);
}

Andrew.


Edited by AndrewC - 08 Jul 14 at 11:59AM
Back to Top
JMLM View Drop Down
Team Player
Team Player
Avatar

Joined: 26 Mar 13
Status: Offline
Points: 40
Post Options Post Options   Thanks (0) Thanks(0)   Quote JMLM Quote  Post ReplyReply Direct Link To This Post Posted: 08 Jul 14 at 1:28PM
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
Back to Top
JMLM View Drop Down
Team Player
Team Player
Avatar

Joined: 26 Mar 13
Status: Offline
Points: 40
Post Options Post Options   Thanks (0) Thanks(0)   Quote JMLM Quote  Post ReplyReply Direct Link To This Post Posted: 16 Aug 14 at 3:03PM
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 : 50090]; 

        [DQPL DrawRotatedCapturedPage: CapturedPageID:500 :500 : 500 : 50090];

        

        

    }




Edited by JMLM - 11 Sep 14 at 4:54PM
Back to Top
JMLM View Drop Down
Team Player
Team Player
Avatar

Joined: 26 Mar 13
Status: Offline
Points: 40
Post Options Post Options   Thanks (0) Thanks(0)   Quote JMLM Quote  Post ReplyReply Direct Link To This Post Posted: 16 Aug 14 at 3:32PM
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

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: 17 Aug 14 at 5:01AM
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.
Back to Top
JMLM View Drop Down
Team Player
Team Player
Avatar

Joined: 26 Mar 13
Status: Offline
Points: 40
Post Options Post Options   Thanks (0) Thanks(0)   Quote JMLM Quote  Post ReplyReply Direct Link To This Post Posted: 19 Aug 14 at 9:42AM
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
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