

' gets annotation locations Dim annotationsCount As Integer = annotations.Count PointF, rotationCenter As System.Drawing. AnnotationDataCollection, angle As Single, offset As System.Drawing. Private Shared Sub RotateAnnotations(annotations As. RotateAnnotations(annotations, angle, offset, rotationCenter)Įnd Sub ''' ''' Rotates annotations by a specified angle. PointF((notRotatedImageWidth / 2F) * scalePixelsToDipX, (notRotatedImageHeight / 2F) * scalePixelsToDipY) ' calcualte the rotation center Dim rotationCenter As New System.Drawing. PointF(((rotatedImageWidth - notRotatedImageWidth) / 2F) * scalePixelsToDipX, ((rotatedImageHeight - notRotatedImageHeight) / 2F) * scalePixelsToDipY) ' calculate offset Dim offset As New System.Drawing. ' get scale factor for converting values from pixels to DIP (device independent pixels) Dim scalePixelsToDipX As Single = 96F / CSng()ĭim scalePixelsToDipY As Single = 96F / CSng() ' get width and height, in pixels, of rotated image Dim rotatedImageWidth As Integer = image.Widthĭim rotatedImageHeight As Integer = image.Height
#Rotate pdf pages with angle mod
Page.Rotate = (page.Rotate + angle) Mod 360 ArgumentException()Įnd If ' get width and height, in pixels, of not rotated image Dim notRotatedImageWidth As Integer = image.Widthĭim notRotatedImageHeight As Integer = image.Height If page Is Nothing Then Throw New System. PdfDocumentController.GetPageAssociatedWithImage(image) AnnotationDataCollection, angle As Integer)Įnd If ' get PDF page associated with image Dim page As. Public Shared Sub RotatePdfPageWithAnnotations(image As Vintasoft.Imaging. (viewer.Image, angle)Įnd If End Sub ''' ''' Rotate PDF page with annotation, without rastering PDF page, ''' by a specified orthogonal angle. RotatePdfPageWithAnnotations(viewer.Image, viewer.AnnotationDataCollection, angle)Įlse ' if image is raster image (not PDF) ' rotate a raster image ArgumentOutOfRangeException()Įnd If ' if image is vector image (PDF) If = "Pdf" Then ' rotate PDF page with annotation, without rastering PDF page, ' by a specified orthogonal angle Public Shared Sub RotateImageWithAnnotations(viewer As. ''' ''' Rotates current image, in annotation viewer, by a specified orthogonal angle.

' The project, which uses this code, must have references to the following assemblies: ' - Vintasoft.Imaging ' - ' - ' - Namespace
