Skip to content

Commit f4f7f9c

Browse files
paodbmlopezFC
authored andcommitted
feat(demo): add demo for rotate options
1 parent c71a989 commit f4f7f9c

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed

vcf-pdf-viewer-demo/src/main/java/com/vaadin/componentfactory/pdfviewer/MainLayout.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,13 @@ public MainLayout() {
3333
new RouterLink("Without zoom dropdown", WithoutZoomDropdownExample.class);
3434
final RouterLink sourceChangeExample =
3535
new RouterLink("Source change", SourceChangeExample.class);
36+
final RouterLink withRotateOptionsExample =
37+
new RouterLink("With rotate options", WithRotateOptionsExample.class);
3638

3739
final VerticalLayout menuLayout = new VerticalLayout(basicExample, zoomExample,
3840
thumbnailsOpenExample, thumbnailsListenerExample, selectPageExample,
3941
customAutoFitZoomLabelsExample, withoutDownloadExample, customTitleExample, withPrintOptionExample,
40-
renderingInteractiveFormsExample, withoutZoomDropdownExample, sourceChangeExample);
42+
renderingInteractiveFormsExample, withoutZoomDropdownExample, sourceChangeExample, withRotateOptionsExample);
4143
addToDrawer(menuLayout);
4244
addToNavbar(drawerToggle);
4345
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
package com.vaadin.componentfactory.pdfviewer;
2+
3+
import com.vaadin.flow.component.html.Div;
4+
import com.vaadin.flow.router.Route;
5+
import com.vaadin.flow.server.StreamResource;
6+
7+
@Route(value = "with-rotate-options", layout = MainLayout.class)
8+
public class WithRotateOptionsExample extends Div {
9+
10+
public WithRotateOptionsExample() {
11+
12+
PdfViewer pdfViewer = new PdfViewer();
13+
pdfViewer.setSizeFull();
14+
StreamResource resource = new StreamResource("example.pdf", () -> getClass().getResourceAsStream("/pdf/example.pdf"));
15+
pdfViewer.setSrc(resource);
16+
pdfViewer.setAddRotateClockwiseButton(true);
17+
pdfViewer.setAddRotateCounterClockwiseButton(true);
18+
add(pdfViewer);
19+
}
20+
21+
}

0 commit comments

Comments
 (0)