Print Page | Close Window

Stamping Rotated Pages...

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: I need help - I can help
Forum Description: Problems and solutions while programming with the Debenu Quick PDF Library and Debenu PDF Viewer SDK
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=421
Printed Date: 25 May 24 at 9:24PM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: Stamping Rotated Pages...
Posted By: cverhoff
Subject: Stamping Rotated Pages...
Date Posted: 23 May 06 at 4:43PM

I have pdf files that need to be rotated and then stamped at the bottom of the page.  They are 8 1/2 x 11 inch pages in landscape position that need to be rotated to portrait position.  When I use the RotatePage Function it also changes the co-ordinate system by 90 degress so that when I try to stamp at the bottom of the 8 1/2 x 11 portrait page it actually stamps on the left or right side not the bottom.  Can someone help me?  I tried adjusting using the SetOrigin function but nothing I try seems to work.  I would GREATLY APPRECIATE ANY aSSISTANCE.

 

THANKS,

CURTIS




Replies:
Posted By: Michel_K17
Date Posted: 17 Jun 06 at 11:41AM
Hi,

   Yes, the rotating of the origin took me a while to figure out, but I finally got it working. I published all of my source code on this forum [ http://www.quickpdf.org/forum/forum_posts.asp?TID=184&PN=1 - here ].

   The source contains a lot of code in order to place the text in any corner, or as a watermark, so you should be able to delete what is not relevant to you. Finally, the lines that are key for what you are looking for are these:

        ' Check for page rotation.
        If oPDF.PageRotation = 0 Then
            ' Set origin to Upper LH
            rtn = oPDF.SetOrigin(1)
            PageHeight = oPDF.PageHeight
            PageWidth = oPDF.PageWidth
        Else
            ' Set origin to Lower LH (before page is rotated for viewing)
            rtn = oPDF.SetOrigin(0)
            ' In this rotation, X&Y are reversed, Height is Width & Vice versa
            PageHeight = oPDF.PageWidth
            PageWidth = oPDF.PageHeight
        End If

.
.
.
.

        ' Apply the text to the page
        If oPDF.PageRotation = 0 Then
            rtn = oPDF.DrawRotatedText(x, y, i, Temp)
        Else
            rtn = oPDF.DrawRotatedText(y, x, 90 + i, Temp)
        End If



   Cheers!

Michel.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.01 - http://www.webwizforums.com
Copyright ©2001-2014 Web Wiz Ltd. - http://www.webwiz.co.uk