Rotate All Pages

Example requests & Code samples for GdPicture Toolkits.
Post Reply
ssaunders
Posts: 6
Joined: Mon Aug 13, 2012 11:39 pm

Rotate All Pages

Post by ssaunders » Tue Aug 14, 2012 12:13 am

Hi,

Can anyone please explain how I can load a PDF or multi-page TIFF file in the GdViewer and then rotate all pages 90 degrees? I can make it loop through the pages and perform the rotation. But when it's done, only the first page is still rotated. When I scroll through the document, all pages are back in the original orientation. This function used to be easy in the Active-X version of GdPicture.

Any ideas or sample VB.Net code? Thanks!


Scott

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: Rotate All Pages

Post by Loïc » Tue Aug 14, 2012 11:02 am

Hello,

That's pretty easy.

For PDF:

Code: Select all

        Dim gdpicturePDF As New GdPicturePDF()
        If gdpicturePDF.LoadFromFile("c:\test.pdf", False) = GdPictureStatus.OK Then
            gdpicturePDF.RotatePages(90)
            GdViewer1.DisplayFromGdPicturePDF(gdpicturePDF)
        End If
For tiff:

Code: Select all

        Dim gdpictureImaging As New GdPictureImaging
        Dim ImageID As Integer = gdpictureImaging.CreateGdPictureImageFromFile("c:\test.tif")
        If ImageID <> 0 Then
            For i As Integer = 1 To gdpictureImaging.TiffGetPageCount(ImageID)
                gdpictureImaging.TiffSelectPage(ImageID, i)
                gdpictureImaging.Rotate(ImageID, RotateFlipType.Rotate90FlipNone)
            Next
            gdpictureImaging.TiffSelectPage(ImageID, 1)
            GdViewer1.DisplayFromGdPictureImage(ImageID)
        End If

Let me know if you need further information.

Kind regards,

Loïc

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest