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!
![]() |
RotatePage repeatedly how? |
Post Reply ![]() |
Author | |
kerrywales ![]() Beginner ![]() Joined: 06 Oct 10 Status: Offline Points: 5 |
![]() ![]() ![]() ![]() ![]() 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 |
|
![]() |
|
Rowan ![]() Moderator Group ![]() ![]() Joined: 10 Jan 09 Status: Offline Points: 398 |
![]() ![]() ![]() ![]() ![]() |
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.
|
|
![]() |
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