Skip to content

Commit

Permalink
Merge pull request #12 from SyncfusionExamples/856503-icon
Browse files Browse the repository at this point in the history
856503 : Customize existing toolbar in PDF Viewer component sample update
  • Loading branch information
SasidharanKaruppiah authored Jan 12, 2024
2 parents e8cfe26 + 2ae7565 commit a2cf689
Showing 1 changed file with 28 additions and 5 deletions.
33 changes: 28 additions & 5 deletions How to/Customize existing toolbar/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,25 +16,48 @@ import Vue from 'vue';
import { PdfViewerPlugin, Toolbar, Magnification, Navigation, LinkAnnotation,
BookmarkView, ThumbnailView, Print, TextSelection, TextSearch,
Annotation, FormDesigner, FormFields } from '@syncfusion/ej2-vue-pdfviewer';
import { ComboBox } from "@syncfusion/ej2-dropdowns";
import { TextBox } from "@syncfusion/ej2-inputs";
Vue.use(PdfViewerPlugin);
var viewer;
export default {
name: 'app',
data () {
// Move the toolItem declaration inside the data function
var toolItem = {
var toolItem1 = {
prefixIcon: 'e-icons e-paste',
id: 'print',
tooltipText: 'Custom toolbar item',
align: 'left'
};
var toolItem2 = {
id: 'download',
text: 'Save',
tooltipText: 'Custom toolbar item',
align: 'right'
};
var LanguageList = ['Typescript', 'Javascript', 'Angular', 'C#', 'C', 'Python'];
var toolItem3 = {
type: 'Input',
tooltipText: 'Language List',
cssClass: 'percentage',
align: 'Left',
id: 'dropdown',
template: new ComboBox({ width: 100, value: 'TypeScript', dataSource: LanguageList, popupWidth: 85, showClearButton: false, readonly: false })
};
var toolItem4 = {
type: 'Input',
tooltipText: 'Text',
align: 'Right',
cssClass: 'find',
id: 'textbox',
template: new TextBox({ width: 125, placeholder: 'Type Here'})
}
return {
documentPath: "https://cdn.syncfusion.com/content/pdf/form-designer.pdf",
resourceUrl: "https://cdn.syncfusion.com/ej2/24.1.41/dist/ej2-pdfviewer-lib",
toolItem: toolItem,
toolbarSettings: {
toolbarItems: [toolItem, 'OpenOption', 'PageNavigationTool', 'MagnificationTool', 'PanTool', 'SelectionTool', 'SearchOption', 'PrintOption', 'DownloadOption', 'UndoRedoTool', 'AnnotationEditTool', 'FormDesignerEditTool', 'CommentTool', 'SubmitForm']
toolbarItems: [toolItem1, toolItem2, 'OpenOption', 'PageNavigationTool', 'MagnificationTool', toolItem3, 'PanTool', 'SelectionTool', 'SearchOption', 'PrintOption', 'DownloadOption', 'UndoRedoTool', 'AnnotationEditTool', 'FormDesignerEditTool', toolItem4, 'CommentTool', 'SubmitForm']
}
};
},
Expand All @@ -55,7 +78,7 @@ export default {
else if (args.item && args.item.id === 'download') {
viewer.download();
}
}
},
}
}
</script>
Expand Down

0 comments on commit a2cf689

Please sign in to comment.