Flip pages in a Document?

Is there any way to flip all pages in a document vertically and horizontally.

If not is there any way to flip the images in the document?

@nielsbosma

We will investigate the feasibility of this feature. Would you please provide a sample file with flipped pages generated using Adobe Reader?

sample.flipped.pdf (3.6 MB)

This is how I did it:

image.png (79.8 KB)

@nielsbosma

A feature request as PDFNET-53230 has been logged in our issue tracking system for your requirements. We will investigate its feasibility and let you know as soon as the feature is available. Please be patient and spare us some time.

I have an idea to solve it like this:

                 using Document document = new Document(inputPath);

                 foreach (var page in document.Pages)
                 {
                     Matrix matrix;
                     if(direction=="flip") 
                     {
                         double width = page.Rect.Width;
                         matrix = new Matrix(-1, 0, 0, 1, width, 0);
                     }
                     else
                     {
                         // flop a.ka. vertical flip
                         double height = page.Rect.Height;
                         matrix = new Matrix(1, 0, 0, -1, 0, height);
                     }
                     
                     page.Contents.Add(new GSave());
                     page.Contents.Add(new ConcatenateMatrix(matrix));
                     page.Contents.Add(new GRestore());
                 }
                 
                 document.Save(outputPath);

But I can’t see any changed when opening the document. Am I doing this correctly?

@nielsbosma

The ticket is currently under the phase of the investigation and we have recorded recently provided information under the ticket as well. We will investigate from this perspective and share updates with you as soon as we have some investigation results. Please spare us some time.

We are sorry for the inconvenience.

1 Like