Skip to content

Commit

Permalink
906190: UGDocumentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Vincentsf4657 committed Sep 27, 2024
1 parent 0b3aecd commit b5afd32
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 16 deletions.
1 change: 0 additions & 1 deletion How to/Customization of Print Quality/src/app/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,5 @@ PdfViewer.Inject(Toolbar, Magnification, Navigation, Annotation, LinkAnnotation,
let pdfviewer: PdfViewer = new PdfViewer();
pdfviewer.documentPath = "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf";
pdfviewer.resourceUrl = "https://cdn.syncfusion.com/ej2/27.1.48/dist/ej2-pdfviewer-lib";
//By changing value of the printScaleFactor we can adjust the quality of the PDF file.
pdfviewer.printScaleFactor=0.5;
pdfviewer.appendTo('#PdfViewer');
41 changes: 41 additions & 0 deletions How to/Customization of Print Quality/webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
const HtmlWebpackPlugin = require("html-webpack-plugin");
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const path = require('path');

module.exports = {
entry: ['./src/app/app.ts', './src/styles/styles.css'],
module: {
rules: [
{
test: /\.ts?$/,
use: 'ts-loader',
exclude: /node_modules/,
},
{
test: /\.css$/,
use: [ MiniCssExtractPlugin.loader, "css-loader" ]
},
],
},
resolve: {
extensions: ['.ts', '.js'],
},
output: {
filename: 'bundle.js',
path: path.resolve(__dirname, 'dist'),
},
plugins: [
new HtmlWebpackPlugin({
template: 'src/index.html'
}),
new MiniCssExtractPlugin({
filename: "bundle.css"
})
],
devServer: {
static: path.join(__dirname, "dist"),
compress: true,
port: 4000,
open: true
},
};
17 changes: 4 additions & 13 deletions How to/Open and Close bookmark pane/src/app/app.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,9 @@
import { PdfViewer, Toolbar, Magnification, Navigation, Annotation, LinkAnnotation, ThumbnailView, BookmarkView, TextSelection, TextSearch, FormFields, FormDesigner} from '@syncfusion/ej2-pdfviewer';
import { PdfViewer, Toolbar, Magnification, Navigation, Annotation, LinkAnnotation, ThumbnailView, BookmarkView, TextSelection, TextSearch, FormFields, FormDesigner, Print} from '@syncfusion/ej2-pdfviewer';

PdfViewer.Inject(Toolbar, Magnification, Navigation, Annotation, LinkAnnotation, ThumbnailView, BookmarkView, TextSelection, TextSearch, FormFields, FormDesigner);
PdfViewer.Inject(Toolbar, Magnification, Navigation, Annotation, LinkAnnotation, ThumbnailView, BookmarkView, TextSelection, TextSearch, FormFields, FormDesigner, Print);

let pdfviewer: PdfViewer = new PdfViewer();
pdfviewer.documentPath = "https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf";
pdfviewer.resourceUrl = "https://cdn.syncfusion.com/ej2/23.1.43/dist/ej2-pdfviewer-lib";

pdfviewer.resourceUrl = "https://cdn.syncfusion.com/ej2/27.1.48/dist/ej2-pdfviewer-lib";
pdfviewer.printScaleFactor=0.5;
pdfviewer.appendTo('#PdfViewer');
document.getElementById('openBookmark').addEventListener('click', () => {
// Open Bookmark pane
pdfviewer.bookmarkViewModule.openBookmarkPane();
});

document.getElementById('closeBookmark').addEventListener('click', () => {
// close Bookmark pane
pdfviewer.bookmarkViewModule.closeBookmarkPane();
});
3 changes: 1 addition & 2 deletions How to/Open and Close bookmark pane/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
</head>

<body>
<button id="openBookmark">Open Bookmark Pane</button>
<button id="closeBookmark">Close Bookmark Pane</button>
<div style="margin-top: 70px;"></div>
<!--Element which will render as PDF Viewer -->
<div id="PdfViewer"></div>
</body>
Expand Down

0 comments on commit b5afd32

Please sign in to comment.