Requested ChangeOrientation operation for ‘Pdf’ document type is not supported groupdocs merger

66 views Asked by At

I am creating a web application and I am using groupdocs for view pdf and other docs, in one of the scenario I want to change particular page orientation of pdf document, I found groupdocs merger with a set of code from here and I modified that code with my expectations which is below,

string filePath = @"c:\sample.pdf";

OrientationOptions orientationOptions = new OrientationOptions(OrientationMode.Landscape, new int[] { 3, 4 });

using (Merger merger = new Merger(filePath))
{
    merger.ChangeOrientation(orientationOptions);
    merger.Save(filePath);
}

but I am getting the below error

Requested ChangeOrientation operation for ‘Pdf’ document type is not supported

I tried this in groupdocs 21.8 version

1

There are 1 answers

1
atirtahir On

I found groupdocs merger with a set of code from here

We cannot reproduce this issue using GroupDocs.Viewer for .NET rotate pages. Have a look at the blow screenshot and the code:

enter image description here

using (Viewer viewer = new Viewer(@"D:/test.pdf"))
 {
     PdfViewOptions viewOptions = new PdfViewOptions(@"D:/output.pdf");
     viewOptions.RotatePage(1, Rotation.On90Degree); 
     viewer.View(viewOptions);
 }

As you are using GroupDocs Viewer API to render/view documents. Please use the above mentioned code. However, this issue exists in GroupDocs.Merger for .NET and we are working on the fix.