Issue with Aspose.Pdf.Image RotatingAngle

I'm having an issue creating a PDF file that conatian rotated images. Near the end of the code, I have the line "Img1.RotatingAngle = objDocReq.Angle". It works fine where the angle is 0. But, if I change the value to 90, 180, or 270, then the image is cropped, empty, or missing altogether. Am I using the class correctly?

pdflicense.SetLicense(HttpContext.Current.Server.MapPath("~/app_data/aspose.total.lic"))
pdfObj.DestinationType = DestinationType.FitPage
With pdfObj.PageSetup
.PageHeight = PageSize.LetterHeight
.PageWidth = PageSize.LetterWidth
.Margin.Left = 0
.Margin.Top = 100 ' allow for the header to display.
End With
Dim Sect1 As Section = New Section(pdfObj)
Dim PgHead As HeaderFooter = New HeaderFooter(Sect1)
Sect1.OddHeader = PgHead : Sect1.EvenHeader = PgHead
pdfObj.Sections.Add(Sect1)
For Each objDoc In objFolderChunkRequest.DocumentRequests
objDocReq = objDoc.Value
ary = GetDisplay(objDocReq.DocSeq, DocTitle)
If Not ary Is Nothing Then
MStrm = New MemoryStream(ary)
If FinalTitle = "" Then FinalTitle = DocTitle
If Headtext Is Nothing Then
Headtext = New Text(PgHead, "ID Number: " + DocTitle)
PgHead.Paragraphs.Add(Headtext)
End If
Dim Img1 As Aspose.Pdf.Image = New Aspose.Pdf.Image(Sect1)
Sect1.Paragraphs.Add(Img1)
With Img1
.ImageInfo.ImageFileType = ImageFileType.Tiff
.ImageInfo.IsBlackWhite = True
.ImageInfo.TiffFrame = -1
.ImageInfo.ImageStream = MStrm
.ImageScale = 0.85F
Img1.RotatingAngle = objDocReq.Angle
End With
End If
MStrm = Nothing
Next

Thanks,

Mike

Hello Mike,

Thanks for considering Aspose.

You can set a float value for Image.RotatingAngle between -90 and 90 which indicates the number of degrees by which the image should be rotated anticlockwise when displayed or printed. For more information please visit RotatingAngle

In case it does not resolve your problem or you've any further query, please feel free to contact.

What do I do if I need to rotate the image 180 degrees? This is by far what we need the most because these are scanned images. And, lots of times users scan them in upside down.

In the code I included above, the image rotates off of the page. I know that it moves it off of the page because I wrote a sample where I increased the angle 10 degrees at a time. By 140 degrees it was completely off of the page. It appeared that the image wasn't rotating around the center of the image. Is there a way to set the center of rotation?

Thanks,

Mike

Hello Mike,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Sorry for replying you so late.

After thorough investigation, we've noticed that in earlier versions of Aspose.Pdf for .NET i.e. 3.9, one can specify the ImageRotation value to any number other than -90 to 90, so it seems that we've recently removed this support. For the sake of correction, I've logged this issue as PDFNET-12126 in our issue tracking system. We'll further look into the details of this problem and will keep you updated you with the status correction.

Your patience and comprehension is greatly appreciated in this regard.

The issues you have found earlier (filed as 12126) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.