Skip to content

Commit

Permalink
feat(demo): add demo for rotate options
Browse files Browse the repository at this point in the history
  • Loading branch information
paodb authored and mlopezFC committed Dec 6, 2024
1 parent 942c6a8 commit e5b9966
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -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);
}

}

0 comments on commit e5b9966

Please sign in to comment.