Rotate tiff with Aspose.Pdf


#1

Hi,

I believe this is a sales query, sales believe differently…

I am currently using Aspose.Pdf and cannot find a way to rotate documents.

I have many tiffs that need to be merged into many pdfs; we can pick up tif files and insert them into pdf documents as it, but some tifs have orientations set (for when they were scanned upside down) which doesn’t get picked up during conversion to pdf.

Do I need to purchase Aspose.Imaging in order to check rotation and rotate images where necessary or is this functionality in Aspose.Pdf somewhere?

Thank you.


#2

@kgclarion,

Can you please provide sample files. We will investigate this on our end to help you out.


#3

aspose_samples.zip (510.6 KB)

Files attached, thanks.


#4

@kgclarion,

I have observed the requirements shared by you and have created an investigation ticket with ID IMAGINGNET-3495 in our issue tracking system to investigate this on our end either it is possible or not. I will share the feedback with you in this regard as soon as possible.


#5

Good morning.

Any idea on an ETA?


#6

@kgclarion

Please use following code snippet in order to meet your requirements:

// Getting the skew angle from scanned text document
using (RasterImage image = (RasterImage)Image.Load("Sample_01_Upright.tif"))
{
    float skewAngle = image.GetSkewAngle();
    // ...
}

// Get rid of the skewed scan with default parameters
using (RasterImage image = (RasterImage)Image.Load("Sample_01_Upright.tif"))
{
    image.NormalizeAngle();
    image.Save("result.tif");
}

// Get rid of the skewed scan with custom parameters
using (RasterImage image = (RasterImage)Image.Load("skewed.png"))
{
    image.NormalizeAngle(false /*do not resize*/, Color.LightGray /*background color*/);
    image.Save("normalized.png");
}

In case you need further assistance, please feel free to let us know.