Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/react-pdf-selection/src/components/PdfViewer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ export class PdfViewer<D extends object> extends Component<PdfViewerProps<D>, Pd
for (const page of pages) {
const width = page.view[2];
const height = page.view[3];
const orientation = page.rotate === 90 ? PDFOrientation.LANDSCAPE : PDFOrientation.PORTRAIT;
const orientation = page.rotate === 270 ? PDFOrientation.LANDSCAPE : PDFOrientation.PORTRAIT;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it should be

Suggested change
const orientation = page.rotate === 270 ? PDFOrientation.LANDSCAPE : PDFOrientation.PORTRAIT;
const orientation = Math.abs(page.rotate) === 90 || Math.abs(page.rotate) === 270 ? PDFOrientation.LANDSCAPE : PDFOrientation.PORTRAIT;

since according to metadata2go 90 and -90 are possible valid values for landscape

originalPageDimensions.set(page.pageNumber, { width, height, orientation });
}

Expand Down