diff --git a/vcf-pdf-viewer-demo/src/main/java/com/vaadin/componentfactory/pdfviewer/MainLayout.java b/vcf-pdf-viewer-demo/src/main/java/com/vaadin/componentfactory/pdfviewer/MainLayout.java index 1155245..e30a5c9 100644 --- a/vcf-pdf-viewer-demo/src/main/java/com/vaadin/componentfactory/pdfviewer/MainLayout.java +++ b/vcf-pdf-viewer-demo/src/main/java/com/vaadin/componentfactory/pdfviewer/MainLayout.java @@ -33,11 +33,13 @@ public MainLayout() { new RouterLink("Without zoom dropdown", WithoutZoomDropdownExample.class); final RouterLink sourceChangeExample = new RouterLink("Source change", SourceChangeExample.class); + final RouterLink withRotateOptionsExample = + new RouterLink("With rotate options", WithRotateOptionsExample.class); final VerticalLayout menuLayout = new VerticalLayout(basicExample, zoomExample, thumbnailsOpenExample, thumbnailsListenerExample, selectPageExample, customAutoFitZoomLabelsExample, withoutDownloadExample, customTitleExample, withPrintOptionExample, - renderingInteractiveFormsExample, withoutZoomDropdownExample, sourceChangeExample); + renderingInteractiveFormsExample, withoutZoomDropdownExample, sourceChangeExample, withRotateOptionsExample); addToDrawer(menuLayout); addToNavbar(drawerToggle); } diff --git a/vcf-pdf-viewer-demo/src/main/java/com/vaadin/componentfactory/pdfviewer/WithRotateOptionsExample.java b/vcf-pdf-viewer-demo/src/main/java/com/vaadin/componentfactory/pdfviewer/WithRotateOptionsExample.java new file mode 100644 index 0000000..58550b7 --- /dev/null +++ b/vcf-pdf-viewer-demo/src/main/java/com/vaadin/componentfactory/pdfviewer/WithRotateOptionsExample.java @@ -0,0 +1,21 @@ +package com.vaadin.componentfactory.pdfviewer; + +import com.vaadin.flow.component.html.Div; +import com.vaadin.flow.router.Route; +import com.vaadin.flow.server.StreamResource; + +@Route(value = "with-rotate-options", layout = MainLayout.class) +public class WithRotateOptionsExample extends Div { + + public WithRotateOptionsExample() { + + PdfViewer pdfViewer = new PdfViewer(); + pdfViewer.setSizeFull(); + StreamResource resource = new StreamResource("example.pdf", () -> getClass().getResourceAsStream("/pdf/example.pdf")); + pdfViewer.setSrc(resource); + pdfViewer.setAddRotateClockwiseButton(true); + pdfViewer.setAddRotateCounterClockwiseButton(true); + add(pdfViewer); + } + +}