diff --git a/.gitignore b/.gitignore
index 63af9df..4d7d293 100644
--- a/.gitignore
+++ b/.gitignore
@@ -32,6 +32,7 @@ error-screenshots/
*.iml
.idea/
.eclipse
+.DS_Store
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
@@ -45,13 +46,12 @@ webpack.config.js
webpack.generated.js
.vscode
-vcf-pdf-viewer-demo/frontend/index.html
-vcf-pdf-viewer-demo/frontend/generated
-vcf-pdf-viewer-demo/src/main/dev-bundle
vcf-pdf-viewer-demo/vite.generated.ts
vcf-pdf-viewer-demo/vite.config.ts
vcf-pdf-viewer-demo/tsconfig.json
vcf-pdf-viewer-demo/types.d.ts
vcf-pdf-viewer-demo/pnpmfile.js
vcf-pdf-viewer-demo/.npmrc
-vcf-pdf-viewer-demo/src/main/dev-bundle
+vcf-pdf-viewer-demo/src/main/bundles
+vcf-pdf-viewer-demo/src/main/frontend/index.html
+vcf-pdf-viewer-demo/src/main/frontend/generated
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index 3bc9d74..ba6eaf4 100644
--- a/pom.xml
+++ b/pom.xml
@@ -3,7 +3,7 @@
org.vaadin.addons.componentfactory
vcf-pdf-viewer-root
- 5.0.1-SNAPSHOT
+ 6.0.0-SNAPSHOT
pom
vcf-pdf-viewer
diff --git a/pom.xml.versionsBackup b/pom.xml.versionsBackup
deleted file mode 100644
index 8c9350b..0000000
--- a/pom.xml.versionsBackup
+++ /dev/null
@@ -1,73 +0,0 @@
-
- 4.0.0
-
- org.vaadin.addons.componentfactory
- vcf-pdf-viewer-root
- 2.7.3-SNAPSHOT
- pom
-
- vcf-pdf-viewer
- vcf-pdf-viewer-demo
-
- Pdf Viewer
- Pdf Viewer component based on pdf.js library
-
-
- 22.0.17
- 1.8
- 1.8
- UTF-8
- UTF-8
-
- 2021
-
- Vaadin Ltd
- https://vaadin.com/
-
-
-
-
-
- ${project.groupId}
- vcf-pdf-viewer
- ${vcf-pdf-viewer.version}
-
-
- com.vaadin
- vaadin-bom
- pom
- import
- ${vaadin.version}
-
-
-
-
-
- Vaadin Directory
- https://maven.vaadin.com/vaadin-addons
-
-
-
- Vaadin prereleases
- https://maven.vaadin.com/vaadin-prereleases
-
-
-
- vaadin-snapshots
- https://oss.sonatype.org/content/repositories/vaadin-snapshots/
-
-
-
-
-
-
- Vaadin prereleases
- https://maven.vaadin.com/vaadin-prereleases
-
-
- vaadin-snapshots
- https://oss.sonatype.org/content/repositories/vaadin-snapshots/
- false
-
-
-
diff --git a/vcf-pdf-viewer-demo/pom.xml b/vcf-pdf-viewer-demo/pom.xml
index 479883a..8223e94 100644
--- a/vcf-pdf-viewer-demo/pom.xml
+++ b/vcf-pdf-viewer-demo/pom.xml
@@ -6,7 +6,7 @@
org.vaadin.addons.componentfactory
vcf-pdf-viewer-demo
- 5.0.1-SNAPSHOT
+ 6.0.0-SNAPSHOT
Pdf Viewer Demo
war
@@ -18,13 +18,11 @@
- 24.8.0
- 9.0.1
- 17
- 17
+ 25.0.0-beta5
+ 21
+ 21
UTF-8
UTF-8
- false
@@ -38,7 +36,6 @@
-
Vaadin Directory
@@ -65,7 +62,9 @@
vaadin-snapshots
https://oss.sonatype.org/content/repositories/vaadin-snapshots/
- false
+
+ false
+
@@ -105,28 +104,15 @@
- org.vaadin.addons.componentfactory
- vcf-pdf-viewer
- ${project.version}
-
-
-
- com.vaadin
- flow-component-demo-helpers
- ${flow.version}
+ org.vaadin.addons.componentfactory
+ vcf-pdf-viewer
+ ${project.version}
org.slf4j
slf4j-simple
-
-
- javax.servlet
- javax.servlet-api
- 3.1.0
-
-
@@ -144,9 +130,9 @@
- org.eclipse.jetty
- jetty-maven-plugin
- 11.0.13
+ org.eclipse.jetty.ee11
+ jetty-ee11-maven-plugin
+ 12.1.4
${project.artifactId}
8081
@@ -162,16 +148,13 @@
prepare-frontend
-
- false
-
org.sonatype.plugins
nexus-staging-maven-plugin
- 1.6.8
+ 1.7.0
true
@@ -179,12 +162,35 @@
org.apache.maven.plugins
maven-war-plugin
- 3.3.1
+ 3.5.0
+
+ false
+
org.apache.maven.plugins
maven-compiler-plugin
- 3.8.1
+ 3.14.1
+
+
+ org.apache.maven.plugins
+ maven-enforcer-plugin
+ 3.6.2
+
+
+ enforce-maven
+
+ enforce
+
+
+
+
+ 3.8
+
+
+
+
+
@@ -224,5 +230,4 @@
-
diff --git a/vcf-pdf-viewer-demo/pom.xml.versionsBackup b/vcf-pdf-viewer-demo/pom.xml.versionsBackup
deleted file mode 100644
index d875609..0000000
--- a/vcf-pdf-viewer-demo/pom.xml.versionsBackup
+++ /dev/null
@@ -1,219 +0,0 @@
-
-
- 4.0.0
-
- org.vaadin.addons.componentfactory
- vcf-pdf-viewer-demo
- 2.7.3-SNAPSHOT
-
- Pdf Viewer Demo
- war
-
- 2020
-
- Vaadin Ltd
- https://vaadin.com/
-
-
-
- 22.0.17
- 9.0.1
- 1.8
- 1.8
- UTF-8
- UTF-8
- false
-
-
-
-
- com.vaadin
- vaadin-bom
- pom
- import
- ${vaadin.version}
-
-
-
-
-
-
-
- Vaadin Directory
- https://maven.vaadin.com/vaadin-addons
-
-
-
- Vaadin prereleases
- https://maven.vaadin.com/vaadin-prereleases
-
-
-
- vaadin-snapshots
- https://oss.sonatype.org/content/repositories/vaadin-snapshots/
-
-
-
-
-
-
- Vaadin prereleases
- https://maven.vaadin.com/vaadin-prereleases
-
-
- vaadin-snapshots
- https://oss.sonatype.org/content/repositories/vaadin-snapshots/
- false
-
-
-
-
- com.vaadin
-
- vaadin-core
-
-
-
-
-
- com.vaadin.webjar
- *
-
-
- org.webjars.bowergithub.insites
- *
-
-
- org.webjars.bowergithub.polymer
- *
-
-
- org.webjars.bowergithub.polymerelements
- *
-
-
- org.webjars.bowergithub.vaadin
- *
-
-
- org.webjars.bowergithub.webcomponents
- *
-
-
-
-
-
- org.vaadin.addons.componentfactory
- vcf-pdf-viewer
- ${project.version}
-
-
-
- com.vaadin
- flow-component-demo-helpers
- ${flow.version}
-
-
-
- org.slf4j
- slf4j-simple
-
-
-
- javax.servlet
- javax.servlet-api
- 3.1.0
-
-
-
-
-
-
-
-
- src/main/java
- false
-
-
- src/main/resources
- false
-
-
-
-
-
- org.eclipse.jetty
- jetty-maven-plugin
- 9.4.15.v20190215
-
- -1
- ${project.artifactId}
- 8081
-
-
-
-
- com.vaadin
- vaadin-maven-plugin
- ${vaadin.version}
-
-
-
- prepare-frontend
-
-
- false
-
-
-
-
-
- org.sonatype.plugins
- nexus-staging-maven-plugin
- 1.6.8
-
- true
-
-
-
-
-
-
-
-
-
- production
-
- true
-
-
-
-
- com.vaadin
- flow-server-production-mode
-
-
-
-
-
-
- com.vaadin
- vaadin-maven-plugin
- ${vaadin.version}
-
-
-
- prepare-frontend
- build-frontend
-
-
-
-
-
-
-
-
-
-
diff --git a/vcf-pdf-viewer-demo/src/main/java/com/vaadin/componentfactory/pdfviewer/AdjustZoomPdfViewerExample.java b/vcf-pdf-viewer-demo/src/main/java/com/vaadin/componentfactory/pdfviewer/AdjustZoomPdfViewerExample.java
index eefcd73..5ad9629 100644
--- a/vcf-pdf-viewer-demo/src/main/java/com/vaadin/componentfactory/pdfviewer/AdjustZoomPdfViewerExample.java
+++ b/vcf-pdf-viewer-demo/src/main/java/com/vaadin/componentfactory/pdfviewer/AdjustZoomPdfViewerExample.java
@@ -2,19 +2,19 @@
import com.vaadin.flow.component.html.Div;
import com.vaadin.flow.router.Route;
-import com.vaadin.flow.server.StreamResource;
+import com.vaadin.flow.server.streams.DownloadHandler;
@Route(value = "zoom", layout = MainLayout.class)
public class AdjustZoomPdfViewerExample extends Div {
-
- public AdjustZoomPdfViewerExample() {
-
- PdfViewer pdfViewer = new PdfViewer();
- pdfViewer.setSizeFull();
- StreamResource resource = new StreamResource("example.pdf", () -> getClass().getResourceAsStream("/pdf/example.pdf"));
- pdfViewer.setSrc(resource);
- pdfViewer.setZoom("page-fit");
- add(pdfViewer);
- }
-
+
+ public AdjustZoomPdfViewerExample() {
+
+ PdfViewer pdfViewer = new PdfViewer();
+ pdfViewer.setSizeFull();
+
+ pdfViewer.setSrc(DownloadHandler.forClassResource(getClass(), "/pdf/example.pdf"));
+ pdfViewer.setZoom("page-fit");
+ add(pdfViewer);
+ }
+
}
diff --git a/vcf-pdf-viewer-demo/src/main/java/com/vaadin/componentfactory/pdfviewer/CustomAutoFitZoomLabelsExample.java b/vcf-pdf-viewer-demo/src/main/java/com/vaadin/componentfactory/pdfviewer/CustomAutoFitZoomLabelsExample.java
index d58cde6..fc0232f 100644
--- a/vcf-pdf-viewer-demo/src/main/java/com/vaadin/componentfactory/pdfviewer/CustomAutoFitZoomLabelsExample.java
+++ b/vcf-pdf-viewer-demo/src/main/java/com/vaadin/componentfactory/pdfviewer/CustomAutoFitZoomLabelsExample.java
@@ -2,20 +2,19 @@
import com.vaadin.flow.component.html.Div;
import com.vaadin.flow.router.Route;
-import com.vaadin.flow.server.StreamResource;
+import com.vaadin.flow.server.streams.DownloadHandler;
@Route(value = "custom-auto-fit-labels", layout = MainLayout.class)
public class CustomAutoFitZoomLabelsExample extends Div {
-
- public CustomAutoFitZoomLabelsExample() {
-
- PdfViewer pdfViewer = new PdfViewer();
- pdfViewer.setSizeFull();
- StreamResource resource = new StreamResource("example.pdf", () -> getClass().getResourceAsStream("/pdf/example.pdf"));
- pdfViewer.setSrc(resource);
- pdfViewer.setAutoZoomOptionLabel("automatic-zoom");
- pdfViewer.setPageFitZoomOptionLabel("page-fit");
- add(pdfViewer);
- }
-
+
+ public CustomAutoFitZoomLabelsExample() {
+
+ PdfViewer pdfViewer = new PdfViewer();
+ pdfViewer.setSizeFull();
+ pdfViewer.setSrc(DownloadHandler.forClassResource(getClass(), "/pdf/example.pdf"));
+ pdfViewer.setAutoZoomOptionLabel("automatic-zoom");
+ pdfViewer.setPageFitZoomOptionLabel("page-fit");
+ add(pdfViewer);
+ }
+
}
diff --git a/vcf-pdf-viewer-demo/src/main/java/com/vaadin/componentfactory/pdfviewer/CustomTitleExample.java b/vcf-pdf-viewer-demo/src/main/java/com/vaadin/componentfactory/pdfviewer/CustomTitleExample.java
index b49e1f4..6af8aea 100644
--- a/vcf-pdf-viewer-demo/src/main/java/com/vaadin/componentfactory/pdfviewer/CustomTitleExample.java
+++ b/vcf-pdf-viewer-demo/src/main/java/com/vaadin/componentfactory/pdfviewer/CustomTitleExample.java
@@ -2,18 +2,17 @@
import com.vaadin.flow.component.html.Div;
import com.vaadin.flow.router.Route;
-import com.vaadin.flow.server.StreamResource;
+import com.vaadin.flow.server.streams.DownloadHandler;
@Route(value = "custom-title", layout = MainLayout.class)
public class CustomTitleExample extends Div {
-
- public CustomTitleExample() {
- PdfViewer pdfViewer = new PdfViewer();
- pdfViewer.setSizeFull();
- StreamResource resource = new StreamResource("example.pdf", () -> getClass().getResourceAsStream("/pdf/example.pdf"));
- pdfViewer.setSrc(resource);
- pdfViewer.setCustomTitle("I'm a custom title");
- add(pdfViewer);
- }
+
+ public CustomTitleExample() {
+ PdfViewer pdfViewer = new PdfViewer();
+ pdfViewer.setSizeFull();
+ pdfViewer.setSrc(DownloadHandler.forClassResource(getClass(), "/pdf/example.pdf"));
+ pdfViewer.setCustomTitle("I'm a custom title");
+ add(pdfViewer);
+ }
}
diff --git a/vcf-pdf-viewer-demo/src/main/java/com/vaadin/componentfactory/pdfviewer/RenderingInteractiveFormsExample.java b/vcf-pdf-viewer-demo/src/main/java/com/vaadin/componentfactory/pdfviewer/RenderingInteractiveFormsExample.java
index f16b1d7..0efe610 100644
--- a/vcf-pdf-viewer-demo/src/main/java/com/vaadin/componentfactory/pdfviewer/RenderingInteractiveFormsExample.java
+++ b/vcf-pdf-viewer-demo/src/main/java/com/vaadin/componentfactory/pdfviewer/RenderingInteractiveFormsExample.java
@@ -2,19 +2,18 @@
import com.vaadin.flow.component.html.Div;
import com.vaadin.flow.router.Route;
-import com.vaadin.flow.server.StreamResource;
+import com.vaadin.flow.server.streams.DownloadHandler;
@Route(value = "rendering-interactive-forms", layout = MainLayout.class)
public class RenderingInteractiveFormsExample extends Div {
-
- public RenderingInteractiveFormsExample() {
-
- PdfViewer pdfViewer = new PdfViewer();
- pdfViewer.setSizeFull();
- StreamResource resource = new StreamResource("Pdf Form Example", () -> getClass().getResourceAsStream("/pdf/pdf-form-example.pdf"));
- pdfViewer.setSrc(resource);
- pdfViewer.setRenderInteractiveForms(false);
- add(pdfViewer);
- }
-
+
+ public RenderingInteractiveFormsExample() {
+
+ PdfViewer pdfViewer = new PdfViewer();
+ pdfViewer.setSizeFull();
+ pdfViewer.setSrc(DownloadHandler.forClassResource(getClass(), "/pdf/pdf-form-example.pdf"));
+ pdfViewer.setRenderInteractiveForms(false);
+ add(pdfViewer);
+ }
+
}
diff --git a/vcf-pdf-viewer-demo/src/main/java/com/vaadin/componentfactory/pdfviewer/SelectPagePdfViewerExample.java b/vcf-pdf-viewer-demo/src/main/java/com/vaadin/componentfactory/pdfviewer/SelectPagePdfViewerExample.java
index a3db385..e964495 100644
--- a/vcf-pdf-viewer-demo/src/main/java/com/vaadin/componentfactory/pdfviewer/SelectPagePdfViewerExample.java
+++ b/vcf-pdf-viewer-demo/src/main/java/com/vaadin/componentfactory/pdfviewer/SelectPagePdfViewerExample.java
@@ -5,26 +5,25 @@
import com.vaadin.flow.component.notification.Notification;
import com.vaadin.flow.component.orderedlayout.HorizontalLayout;
import com.vaadin.flow.router.Route;
-import com.vaadin.flow.server.StreamResource;
+import com.vaadin.flow.server.streams.DownloadHandler;
@Route(value = "select-page", layout = MainLayout.class)
public class SelectPagePdfViewerExample extends Div {
-
- public SelectPagePdfViewerExample() {
-
- PdfViewer pdfViewer = new PdfViewer();
- pdfViewer.setSizeFull();
- StreamResource resource = new StreamResource("example.pdf", () -> getClass().getResourceAsStream("/pdf/example.pdf"));
- pdfViewer.setSrc(resource);
- pdfViewer.setPage(4);
- add(pdfViewer);
-
- HorizontalLayout layout = new HorizontalLayout();
- layout.setMargin(true);
- layout.add(new Button("Click to know current page", e -> {
- Notification.show("Current Page: " + pdfViewer.getCurrentPage());
- }));
- add(layout);
- }
-
+
+ public SelectPagePdfViewerExample() {
+
+ PdfViewer pdfViewer = new PdfViewer();
+ pdfViewer.setSizeFull();
+ pdfViewer.setSrc(DownloadHandler.forClassResource(getClass(), "/pdf/example.pdf"));
+ pdfViewer.setPage(4);
+ add(pdfViewer);
+
+ HorizontalLayout layout = new HorizontalLayout();
+ layout.setMargin(true);
+ layout.add(new Button("Click to know current page", e -> {
+ Notification.show("Current Page: " + pdfViewer.getCurrentPage());
+ }));
+ add(layout);
+ }
+
}
diff --git a/vcf-pdf-viewer-demo/src/main/java/com/vaadin/componentfactory/pdfviewer/SourceChangeExample.java b/vcf-pdf-viewer-demo/src/main/java/com/vaadin/componentfactory/pdfviewer/SourceChangeExample.java
index 4a8425d..3ea2cd8 100644
--- a/vcf-pdf-viewer-demo/src/main/java/com/vaadin/componentfactory/pdfviewer/SourceChangeExample.java
+++ b/vcf-pdf-viewer-demo/src/main/java/com/vaadin/componentfactory/pdfviewer/SourceChangeExample.java
@@ -3,28 +3,28 @@
import com.vaadin.flow.component.combobox.ComboBox;
import com.vaadin.flow.component.html.Div;
import com.vaadin.flow.router.Route;
-import com.vaadin.flow.server.StreamResource;
+import com.vaadin.flow.server.streams.DownloadHandler;
@Route(value = "source-change", layout = MainLayout.class)
public class SourceChangeExample extends Div {
-
- public SourceChangeExample() {
-
- PdfViewer pdfViewer = new PdfViewer();
- pdfViewer.setSizeFull();
-
- ComboBox filesComboBox = new ComboBox<>("Select PDF");
- filesComboBox.setWidth("300px");
- filesComboBox.setPlaceholder("Select a file");
- filesComboBox.setItems("bitcoin.pdf", "example.pdf", "example-invoice.pdf");
- filesComboBox.addValueChangeListener(e -> {
- String filename = e.getValue();
- StreamResource resource = new StreamResource(filename,
- () -> getClass().getResourceAsStream("/pdf/" + filename));
- pdfViewer.setSrc(resource);
- });
- add(filesComboBox, pdfViewer);
- }
-
+ public SourceChangeExample() {
+
+ PdfViewer pdfViewer = new PdfViewer();
+ pdfViewer.setSizeFull();
+
+ ComboBox filesComboBox = new ComboBox<>("Select PDF");
+ filesComboBox.setWidth("300px");
+ filesComboBox.setPlaceholder("Select a file");
+ filesComboBox.setItems("bitcoin.pdf", "example.pdf", "example-invoice.pdf");
+ filesComboBox.addValueChangeListener(e -> {
+ String filename = e.getValue();
+ var filePath = "/pdf/" + filename;
+ var downloadHandler = DownloadHandler.forClassResource(getClass(), filePath);
+ pdfViewer.setSrc(downloadHandler);
+ });
+
+ add(filesComboBox, pdfViewer);
+ }
+
}
diff --git a/vcf-pdf-viewer-demo/src/main/java/com/vaadin/componentfactory/pdfviewer/ThumbnailsListenerExample.java b/vcf-pdf-viewer-demo/src/main/java/com/vaadin/componentfactory/pdfviewer/ThumbnailsListenerExample.java
index 5a436c3..f0a771a 100644
--- a/vcf-pdf-viewer-demo/src/main/java/com/vaadin/componentfactory/pdfviewer/ThumbnailsListenerExample.java
+++ b/vcf-pdf-viewer-demo/src/main/java/com/vaadin/componentfactory/pdfviewer/ThumbnailsListenerExample.java
@@ -3,21 +3,20 @@
import com.vaadin.flow.component.html.Div;
import com.vaadin.flow.component.notification.Notification;
import com.vaadin.flow.router.Route;
-import com.vaadin.flow.server.StreamResource;
+import com.vaadin.flow.server.streams.DownloadHandler;
@Route(value = "thumbnails-listener", layout = MainLayout.class)
public class ThumbnailsListenerExample extends Div {
-
- public ThumbnailsListenerExample() {
-
- PdfViewer pdfViewer = new PdfViewer();
- pdfViewer.setSizeFull();
- StreamResource resource = new StreamResource("example.pdf", () -> getClass().getResourceAsStream("/pdf/example.pdf"));
- pdfViewer.setSrc(resource);
- pdfViewer.addThumbnailClickedListener(e -> {
- Notification.show("Selected page on thumbnail click: " + e.getSelectedPage());
- });
- add(pdfViewer);
- }
-
+
+ public ThumbnailsListenerExample() {
+
+ PdfViewer pdfViewer = new PdfViewer();
+ pdfViewer.setSizeFull();
+ pdfViewer.setSrc(DownloadHandler.forClassResource(getClass(), "/pdf/example.pdf"));
+ pdfViewer.addThumbnailClickedListener(e -> {
+ Notification.show("Selected page on thumbnail click: " + e.getSelectedPage());
+ });
+ add(pdfViewer);
+ }
+
}
diff --git a/vcf-pdf-viewer-demo/src/main/java/com/vaadin/componentfactory/pdfviewer/ThumbnailsViewerOpenExample.java b/vcf-pdf-viewer-demo/src/main/java/com/vaadin/componentfactory/pdfviewer/ThumbnailsViewerOpenExample.java
index 418569f..dcaf9b2 100644
--- a/vcf-pdf-viewer-demo/src/main/java/com/vaadin/componentfactory/pdfviewer/ThumbnailsViewerOpenExample.java
+++ b/vcf-pdf-viewer-demo/src/main/java/com/vaadin/componentfactory/pdfviewer/ThumbnailsViewerOpenExample.java
@@ -2,19 +2,18 @@
import com.vaadin.flow.component.html.Div;
import com.vaadin.flow.router.Route;
-import com.vaadin.flow.server.StreamResource;
+import com.vaadin.flow.server.streams.DownloadHandler;
@Route(value = "thumbnails-open", layout = MainLayout.class)
public class ThumbnailsViewerOpenExample extends Div {
-
- public ThumbnailsViewerOpenExample() {
-
- PdfViewer pdfViewer = new PdfViewer();
- pdfViewer.setSizeFull();
- StreamResource resource = new StreamResource("example.pdf", () -> getClass().getResourceAsStream("/pdf/example.pdf"));
- pdfViewer.setSrc(resource);
- pdfViewer.openThumbnailsView();
- add(pdfViewer);
- }
-
+
+ public ThumbnailsViewerOpenExample() {
+
+ PdfViewer pdfViewer = new PdfViewer();
+ pdfViewer.setSizeFull();
+ pdfViewer.setSrc(DownloadHandler.forClassResource(getClass(), "/pdf/example.pdf"));
+ pdfViewer.openThumbnailsView();
+ add(pdfViewer);
+ }
+
}
diff --git a/vcf-pdf-viewer-demo/src/main/java/com/vaadin/componentfactory/pdfviewer/WithPrintOptionExample.java b/vcf-pdf-viewer-demo/src/main/java/com/vaadin/componentfactory/pdfviewer/WithPrintOptionExample.java
index 5161576..b0fc2d8 100644
--- a/vcf-pdf-viewer-demo/src/main/java/com/vaadin/componentfactory/pdfviewer/WithPrintOptionExample.java
+++ b/vcf-pdf-viewer-demo/src/main/java/com/vaadin/componentfactory/pdfviewer/WithPrintOptionExample.java
@@ -2,19 +2,18 @@
import com.vaadin.flow.component.html.Div;
import com.vaadin.flow.router.Route;
-import com.vaadin.flow.server.StreamResource;
+import com.vaadin.flow.server.streams.DownloadHandler;
@Route(value = "with-print", layout = MainLayout.class)
public class WithPrintOptionExample extends Div {
-
- public WithPrintOptionExample() {
-
- PdfViewer pdfViewer = new PdfViewer();
- pdfViewer.setSizeFull();
- StreamResource resource = new StreamResource("example.pdf", () -> getClass().getResourceAsStream("/pdf/example.pdf"));
- pdfViewer.setSrc(resource);
- pdfViewer.setAddPrintButton(true);
- add(pdfViewer);
- }
-
+
+ public WithPrintOptionExample() {
+
+ PdfViewer pdfViewer = new PdfViewer();
+ pdfViewer.setSizeFull();
+ pdfViewer.setSrc(DownloadHandler.forClassResource(getClass(), "/pdf/example.pdf"));
+ pdfViewer.setAddPrintButton(true);
+ add(pdfViewer);
+ }
+
}
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
index 58550b7..60a4ce0 100644
--- 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
@@ -2,20 +2,19 @@
import com.vaadin.flow.component.html.Div;
import com.vaadin.flow.router.Route;
-import com.vaadin.flow.server.StreamResource;
+import com.vaadin.flow.server.streams.DownloadHandler;
@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);
- }
-
+
+ public WithRotateOptionsExample() {
+
+ PdfViewer pdfViewer = new PdfViewer();
+ pdfViewer.setSizeFull();
+ pdfViewer.setSrc(DownloadHandler.forClassResource(getClass(), "/pdf/example.pdf"));
+ pdfViewer.setAddRotateClockwiseButton(true);
+ pdfViewer.setAddRotateCounterClockwiseButton(true);
+ add(pdfViewer);
+ }
+
}
diff --git a/vcf-pdf-viewer-demo/src/main/java/com/vaadin/componentfactory/pdfviewer/WithoutDownloadExample.java b/vcf-pdf-viewer-demo/src/main/java/com/vaadin/componentfactory/pdfviewer/WithoutDownloadExample.java
index 96b98eb..e8c2a57 100644
--- a/vcf-pdf-viewer-demo/src/main/java/com/vaadin/componentfactory/pdfviewer/WithoutDownloadExample.java
+++ b/vcf-pdf-viewer-demo/src/main/java/com/vaadin/componentfactory/pdfviewer/WithoutDownloadExample.java
@@ -2,19 +2,18 @@
import com.vaadin.flow.component.html.Div;
import com.vaadin.flow.router.Route;
-import com.vaadin.flow.server.StreamResource;
+import com.vaadin.flow.server.streams.DownloadHandler;
@Route(value = "without-download", layout = MainLayout.class)
public class WithoutDownloadExample extends Div {
-
- public WithoutDownloadExample() {
-
- PdfViewer pdfViewer = new PdfViewer();
- pdfViewer.setSizeFull();
- StreamResource resource = new StreamResource("example.pdf", () -> getClass().getResourceAsStream("/pdf/example.pdf"));
- pdfViewer.setSrc(resource);
- pdfViewer.setAddDownloadButton(false);
- add(pdfViewer);
- }
-
+
+ public WithoutDownloadExample() {
+
+ PdfViewer pdfViewer = new PdfViewer();
+ pdfViewer.setSizeFull();
+ pdfViewer.setSrc(DownloadHandler.forClassResource(getClass(), "/pdf/example.pdf"));
+ pdfViewer.setAddDownloadButton(false);
+ add(pdfViewer);
+ }
+
}
diff --git a/vcf-pdf-viewer-demo/src/main/java/com/vaadin/componentfactory/pdfviewer/WithoutZoomDropdownExample.java b/vcf-pdf-viewer-demo/src/main/java/com/vaadin/componentfactory/pdfviewer/WithoutZoomDropdownExample.java
index 23729a2..1c68c7c 100644
--- a/vcf-pdf-viewer-demo/src/main/java/com/vaadin/componentfactory/pdfviewer/WithoutZoomDropdownExample.java
+++ b/vcf-pdf-viewer-demo/src/main/java/com/vaadin/componentfactory/pdfviewer/WithoutZoomDropdownExample.java
@@ -2,19 +2,18 @@
import com.vaadin.flow.component.html.Div;
import com.vaadin.flow.router.Route;
-import com.vaadin.flow.server.StreamResource;
+import com.vaadin.flow.server.streams.DownloadHandler;
@Route(value = "without-zoom-dropdown", layout = MainLayout.class)
public class WithoutZoomDropdownExample extends Div {
-
- public WithoutZoomDropdownExample() {
-
- PdfViewer pdfViewer = new PdfViewer();
- pdfViewer.setSizeFull();
- StreamResource resource = new StreamResource("example.pdf", () -> getClass().getResourceAsStream("/pdf/example.pdf"));
- pdfViewer.setSrc(resource);
- pdfViewer.hideZoom(true);
- add(pdfViewer);
- }
-
+
+ public WithoutZoomDropdownExample() {
+
+ PdfViewer pdfViewer = new PdfViewer();
+ pdfViewer.setSizeFull();
+ pdfViewer.setSrc(DownloadHandler.forClassResource(getClass(), "/pdf/example.pdf"));
+ pdfViewer.hideZoom(true);
+ add(pdfViewer);
+ }
+
}
diff --git a/vcf-pdf-viewer/pom.xml b/vcf-pdf-viewer/pom.xml
index c4603cf..de70217 100644
--- a/vcf-pdf-viewer/pom.xml
+++ b/vcf-pdf-viewer/pom.xml
@@ -6,7 +6,7 @@
org.vaadin.addons.componentfactory
vcf-pdf-viewer
- 5.0.1-SNAPSHOT
+ 6.0.0-SNAPSHOT
jar
Pdf Viewer
@@ -19,9 +19,9 @@
- 24.8.0
- 17
- 17
+ 25.0.0-beta5
+ 21
+ 21
UTF-8
UTF-8
@@ -63,7 +63,9 @@
vaadin-snapshots
https://oss.sonatype.org/content/repositories/vaadin-snapshots/
- false
+
+ false
+
@@ -108,8 +110,8 @@
org.codehaus.mojo
license-maven-plugin
- 2.0.0
-
+ 2.7.0
+
apache_v2
@@ -131,7 +133,7 @@
org.apache.maven.plugins
maven-javadoc-plugin
- 2.10.4
+ 3.12.0
8
@@ -147,7 +149,7 @@
org.apache.maven.plugins
maven-source-plugin
- 2.2.1
+ 3.3.1
attach-sources
@@ -160,7 +162,7 @@
org.apache.maven.plugins
maven-jar-plugin
- 3.0.2
+ 3.5.0
true
@@ -174,6 +176,26 @@
+
+ org.apache.maven.plugins
+ maven-enforcer-plugin
+ 3.6.2
+
+
+ enforce-maven
+
+ enforce
+
+
+
+
+ 3.8
+
+
+
+
+
+
@@ -184,7 +206,7 @@
org.apache.maven.plugins
maven-assembly-plugin
- 3.1.0
+ 3.7.1
false
@@ -203,7 +225,7 @@
org.apache.maven.plugins
maven-source-plugin
- 3.0.1
+ 3.3.1
attach-sources
@@ -217,7 +239,7 @@
org.apache.maven.plugins
maven-javadoc-plugin
- 3.0.1
+ 3.12.0
attach-javadocs
@@ -229,7 +251,7 @@
true
- -Xdoclint:none
+ none
diff --git a/vcf-pdf-viewer/pom.xml.versionsBackup b/vcf-pdf-viewer/pom.xml.versionsBackup
deleted file mode 100644
index e633fb8..0000000
--- a/vcf-pdf-viewer/pom.xml.versionsBackup
+++ /dev/null
@@ -1,239 +0,0 @@
-
-
- 4.0.0
-
- org.vaadin.addons.componentfactory
- vcf-pdf-viewer
- 2.7.3-SNAPSHOT
- jar
-
- Pdf Viewer
- Pdf Viewer component
-
- 2021
-
- Vaadin Ltd
- https://vaadin.com/
-
-
-
- 22.0.17
- 1.8
- 1.8
- UTF-8
- UTF-8
-
-
-
-
-
- com.vaadin
- vaadin-bom
- pom
- import
- ${vaadin.version}
-
-
-
-
-
- Vaadin Directory
- https://maven.vaadin.com/vaadin-addons
-
-
-
- Vaadin prereleases
- https://maven.vaadin.com/vaadin-prereleases
-
-
-
- vaadin-snapshots
- https://oss.sonatype.org/content/repositories/vaadin-snapshots/
-
-
-
-
-
-
- Vaadin prereleases
- http://maven.vaadin.com/vaadin-prereleases
-
-
- vaadin-snapshots
- https://oss.sonatype.org/content/repositories/vaadin-snapshots/
- false
-
-
-
-
- com.vaadin
-
- vaadin-core
-
-
-
-
-
- com.vaadin.webjar
- *
-
-
- org.webjars.bowergithub.insites
- *
-
-
- org.webjars.bowergithub.polymer
- *
-
-
- org.webjars.bowergithub.polymerelements
- *
-
-
- org.webjars.bowergithub.vaadin
- *
-
-
- org.webjars.bowergithub.webcomponents
- *
-
-
-
-
-
-
-
-
- org.codehaus.mojo
- license-maven-plugin
- 2.0.0
-
-
- apache_v2
-
- **/main/**/*.java
- **/main/**/*.js
-
- true
- true
-
-
-
-
- check-file-header
-
- process-sources
-
-
-
-
- org.apache.maven.plugins
- maven-javadoc-plugin
- 2.10.4
-
- 8
-
-
-
- attach-javadoc
-
- jar
-
-
-
-
-
- org.apache.maven.plugins
- maven-source-plugin
- 2.2.1
-
-
- attach-sources
-
- jar
-
-
-
-
-
- org.apache.maven.plugins
- maven-jar-plugin
- 3.0.2
-
-
- true
-
- false
- true
-
-
- 1
-
-
-
-
-
-
-
-
- directory
-
-
-
- org.apache.maven.plugins
- maven-assembly-plugin
- 3.1.0
-
- false
-
- assembly/assembly.xml
-
-
-
-
-
- single
-
- install
-
-
-
-
- org.apache.maven.plugins
- maven-source-plugin
- 3.0.1
-
-
- attach-sources
- verify
-
- jar-no-fork
-
-
-
-
-
- org.apache.maven.plugins
- maven-javadoc-plugin
- 3.0.1
-
-
- attach-javadocs
- verify
-
- jar
-
-
-
-
- true
- -Xdoclint:none
-
-
-
-
-
-
-
diff --git a/vcf-pdf-viewer/src/main/java/com/vaadin/componentfactory/pdfviewer/PdfViewer.java b/vcf-pdf-viewer/src/main/java/com/vaadin/componentfactory/pdfviewer/PdfViewer.java
index c5d0267..7ea2d40 100644
--- a/vcf-pdf-viewer/src/main/java/com/vaadin/componentfactory/pdfviewer/PdfViewer.java
+++ b/vcf-pdf-viewer/src/main/java/com/vaadin/componentfactory/pdfviewer/PdfViewer.java
@@ -39,7 +39,7 @@
import org.apache.commons.lang3.StringUtils;
@Tag("vcf-pdf-viewer")
-@NpmPackage(value = "@vaadin-component-factory/vcf-pdf-viewer", version = "3.1.0")
+@NpmPackage(value = "@vaadin-component-factory/vcf-pdf-viewer", version = "4.0.0")
@NpmPackage(value = "print-js", version = "1.6.0")
@JsModule("@vaadin-component-factory/vcf-pdf-viewer/vcf-pdf-viewer.js")
@JsModule("./src/pdf-print.js")