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 - RotatePage repeatedly how?
  FAQ FAQ  Forum Search   Register Register  Login Login

RotatePage repeatedly how?

 Post Reply Post Reply
Author
Message
kerrywales View Drop Down
Beginner
Beginner


Joined: 06 Oct 10
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote kerrywales Quote  Post ReplyReply Direct Link To This Post Topic: RotatePage repeatedly how?
    Posted: 06 Oct 10 at 10:43PM
I have code to scan in to a pdf. I need a simple viewer to allow the user some simple actions on the scanned in file.

I have all that I need except one. The ability to rotate the page as needed. Here is my code for a rotate clockwise. (I am using CS 2008 & c#)

private void btnViewScanRotateClockwise_Click(object sender, EventArgs e)
        {
            DLL myDLL = new DLL("QuickPDFDLL0721.dll");
            int InstanceID;
            InstanceID = myDLL.QuickPDFCreateLibrary();
            if (myDLL.QuickPDFUnlockKey(InstanceID, "license here") == 1)
            {
                System.Text.UTF8Encoding UTF8 = new System.Text.UTF8Encoding();
                Byte[] BytesMessage = UTF8.GetBytes(ScannedFile);
                myDLL.QuickPDFLoadFromFile(InstanceID, BytesMessage);
                myDLL.QuickPDFSelectPage(InstanceID, CurrentPageNo);
//CurrentPageNo is the var in my Viewer used to know which is the current page to be viewed
//The rotate page only works for the first 90 deg rotation
                myDLL.QuickPDFRotatePage(InstanceID, 90);
                MessageBox.Show(myDLL.QuickPDFGetOrigin(InstanceID).ToString());
                myDLL.QuickPDFSaveToFile(InstanceID, BytesMessage);
//DisplayPage is my routine to display the page in a PictureBox on the screen
                DisplayPage();
                myDLL.QuickPDFReleaseLibrary(InstanceID);
            }
        }

This rotates the page 90 deg once and saves the file displaying the page rotated in its new position. I am used to this being the anchor point. So I expected running the routine again to take the page in its current position and rotate it another 90 deg. It doesn't.
I therefore presume that instead of rotating the page in the file it maintains it's original position but stores some kine of offset that tells it to rotate the image 90 deg in the display.

Therefore for me to rotate it again I must find out where my starting point is i.e. if it is in the 90 deg position then I execute the rotate to 180 etc.

I cannot find the call to make to know my starting point in order to rotate it further.

When I have worked it out clockwise then I can right its mirror routine to write the anticlockise code.

Regards

Kerry
Back to Top
Rowan View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 10 Jan 09
Status: Offline
Points: 398
Post Options Post Options   Thanks (0) Thanks(0)   Quote Rowan Quote  Post ReplyReply Direct Link To This Post Posted: 20 Oct 10 at 1:52PM
Hi Kerry,

You can use the PageRotation function to determine the current rotation of a page -- that function will help you determine your starting point.

PageRotation

- Rowan.
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