WebViewer Version: latest
I’ve got a button to apply rotation on specific pages of a document like the following:
const getRotation = (curr) => {
const {
E_0, E_90, E_180, E_270
} = webViewerInstance.Core.PageRotation;
switch (curr) {
case 270:
case 3:
return E_270;
case 180:
case 2:
return E_180;
case 90:
case 1:
return E_90;
default:
return E_0;
}
};
// Add rotation button to main toolbar
webViewerInstance.UI.setHeaderItems((header) => {
header.get('viewControlsButton').insertAfter({
type: 'actionButton',
dataElement: 'rotateCustomButton',
img: 'icon-header-page-manipulation-page-rotation-clockwise-fill',
onClick: () => {
const pageNum = documentViewer.getCurrentPage();
const currentRotations = documentViewer.getPageRotations();
const rotation = getNewRotation(currentRotations[pageNum]);
documentViewer.setRotation(rotation, pageNum);
documentViewer.trigger(customEvent.ROTATE_PAGE, { pageNum, rotation });
}
});
});
So I’ve got a document with some pages rotated. But while exporting / downloading them from the viewer, no rotations are saved on the pages.
I’ve got a button as follows:
// Customized download button to avoid downloading PDFs with annotations
webViewerInstance.UI.updateElement('downloadButton', {
onClick: () => {
webViewerInstance.UI.downloadPdf({
includeAnnotations: false
});
},
});
No options are available to enable keeping the rotations applied.
Is there any way to do this?
Regards