Quantcast
Channel: Aspose.Pdf Product Family
Viewing all articles
Browse latest Browse all 3131

PDF to TIFF conversion problem with rotation

$
0
0
If I do this:

Aspose.Pdf.Document document = new Aspose.Pdf.Document(pdfBytesStream)

tiffDevice.Process(document, 1, 1, "C:/Test/Documents/Test.tif")

where pdfBytesStream are data bytes of a PDF.

If the source PDF is Landscape the resulting tiff is correct.
If the source PDF is Portrait the resulting tiff is rotated 90 degrees to the right.
Basically, they are both 3300 pixels wide by 2550 pixels high.
I would expect the portrait PDF to be rendered as a tiff that is 3300 pixels high and 2550 pixels wide and not rotated.

I saved the pdfBytesStream to an actual tiff prior to the tiffDevice.Process to make sure they were good and the generated PDFs are perfect - oriented properly.

I must missing something in tiffDevice.Process to get the rotation set right.

I checked the height and width of the pdf page for both portrait and landscape pdfs and they are:
Portrait: Height=792, Width=612
Landscape: Height=612, Width=792
So that looks fine going in.

foreach(Page page in document.Pages)
{
Aspose.Pdf.Rectangle rectangle = page.MediaBox;
rectangle.Width;
rectangle.Height;
}


Viewing all articles
Browse latest Browse all 3131

Trending Articles