Skip to content

931372: Adding a Custom Feature for Attaching Files to PDFs #65

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Editor configuration, see https://editorconfig.org
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true

[*.ts]
quote_type = single

[*.md]
max_line_length = off
trim_trailing_whitespace = false
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# See http://help.github.com/ignore-files/ for more about ignoring files.

# Compiled output
/dist
/tmp
/out-tsc
/bazel-out

# Node
/node_modules
npm-debug.log
yarn-error.log

# IDEs and editors
.idea/
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace

# Visual Studio Code
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
.history/*

# Miscellaneous
/.angular/cache
.sass-cache/
/connect.lock
/coverage
/libpeerconnection.log
testem.log
/typings

# System files
.DS_Store
Thumbs.db
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Attachpdf

This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 15.2.11.

## Development server

Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The application will automatically reload if you change any of the source files.

## Code scaffolding

Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.

## Build

Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory.

## Running unit tests

Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).

## Running end-to-end tests

Run `ng e2e` to execute the end-to-end tests via a platform of your choice. To use this command, you need to first add a package that implements end-to-end testing capabilities.

## Further help

To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"attachpdf": {
"projectType": "application",
"schematics": {},
"root": "",
"sourceRoot": "src",
"prefix": "app",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist/attachpdf",
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": [
"zone.js"
],
"tsConfig": "tsconfig.app.json",
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [
"src/styles.css"
],
"scripts": []
},
"configurations": {
"production": {
"budgets": [
{
"type": "initial",
"maximumWarning": "500kb",
"maximumError": "1mb"
},
{
"type": "anyComponentStyle",
"maximumWarning": "2kb",
"maximumError": "4kb"
}
],
"outputHashing": "all"
},
"development": {
"buildOptimizer": false,
"optimization": false,
"vendorChunk": true,
"extractLicenses": false,
"sourceMap": true,
"namedChunks": true
}
},
"defaultConfiguration": "production"
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"configurations": {
"production": {
"browserTarget": "attachpdf:build:production"
},
"development": {
"browserTarget": "attachpdf:build:development"
}
},
"defaultConfiguration": "development"
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "attachpdf:build"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"polyfills": [
"zone.js",
"zone.js/testing"
],
"tsConfig": "tsconfig.spec.json",
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [
"src/styles.css"
],
"scripts": []
}
}
}
}
},
"cli": {
"analytics": "75704c67-92cb-4192-8fe2-264e6202c84f"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"name": "attachpdf",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"watch": "ng build --watch --configuration development",
"test": "ng test"
},
"private": true,
"dependencies": {
"@angular/animations": "^15.2.0",
"@angular/common": "^15.2.0",
"@angular/compiler": "^15.2.0",
"@angular/core": "^15.2.0",
"@angular/forms": "^15.2.0",
"@angular/platform-browser": "^15.2.0",
"@angular/platform-browser-dynamic": "^15.2.0",
"@angular/router": "^15.2.0",
"@syncfusion/ej2-angular-buttons": "*",
"@syncfusion/ej2-angular-navigations": "*",
"@syncfusion/ej2-angular-pdfviewer": "*",
"@syncfusion/ej2-pdf": "*",
"rxjs": "~7.8.0",
"tslib": "^2.3.0",
"zone.js": "~0.12.0"
},
"devDependencies": {
"@angular-devkit/build-angular": "^15.2.11",
"@angular/cli": "~15.2.11",
"@angular/compiler-cli": "^15.2.0",
"@types/jasmine": "~4.3.0",
"jasmine-core": "~4.5.0",
"karma": "~6.4.0",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage": "~2.2.0",
"karma-jasmine": "~5.1.0",
"karma-jasmine-html-reporter": "~2.0.0",
"typescript": "~4.9.4"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';

const routes: Routes = [];

@NgModule({
imports: [RouterModule.forRoot(routes)],
exports: [RouterModule]
})
export class AppRoutingModule { }
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
<ejs-sidebar *ngIf="!isMobile" id="defaultSidebar" #sidebar cssClass="e-outline" class="e-pv-e-sign-default-sidebar" width="200px" position="Left" [enableGestures]="false">
<div class="e-pv-e-sign-content content-wrapper" style="margin: 7px;">
<div style="font-weight: 500; font-size: 16px; width: 43px; height: 24px; margin: 15px 10px 5px;">
Fields
</div>
<ejs-dropdownlist #userMenu id="e-pv-e-sign-employees" [dataSource]="userDetails" index = 0
[fields]="fields" (select)="userChange($event)" [popupHeight]="height">
<ng-template #itemTemplate let-data>
<div style="display: flex; height: 50px; width: 200px;">
<img class="e-pv-e-sign-empImage" height="30px" width="30px"
style="margin: 10px 6px; border-radius: 50%"
[ngStyle]="{'border': '1px solid ' + (data.Mail === 'andrew@mycompany.com' ? 'red' : 'green')}"
src="https://ej2.syncfusion.com/angular/demos/assets/pdf-viewer/employees/{{data.Eimg}}.png"
alt="{{data.Eimg}}" />
<div>
<div class="e-pv-e-sign-ename">{{data.Name}}</div>
<div class="e-pv-e-sign-ejob">{{data.Mail}}</div>
</div>
</div>
</ng-template>
<ng-template #valueTemplate let-data>
<div style="display: flex;">
<img id="user-img" class="e-pv-e-sign-valueTemp" style="margin: 4px 6px; border-radius: 50%"
[ngStyle]="{'border': '1px solid ' + currentUserBorderColor}"
src="https://ej2.syncfusion.com/angular/demos/assets/pdf-viewer/employees/{{data.Eimg}}.png"
height="30px" width="30px" alt="{{data.Eimg}}" />
<div>
<div class="e-pv-e-sign-name" style="margin-top: 3px;">
{{data.Name}}
</div>
<div class="e-pv-e-sign-job">{{data.Mail}}</div>
</div>
</div>
</ng-template>
</ejs-dropdownlist>
<div style="display: flex;">
<button ejs-button #signatureDiv cssClass="e-outline" (click)="signature($event)" class="e-pv-e-sign-form-field-property">
<i class="e-icons e-signature"></i>
<span style="font-size: 11px; margin-top: 6px;">Signature</span>
</button>
<button ejs-button #initialDiv cssClass="e-outline" (click)="initial($event)" class="e-pv-e-sign-form-field-property">
<i class="e-icons e-font-name"></i>
<span style="font-size: 11px; margin-top: 6px;">Initial</span>
</button>
</div>
<div style="display: flex;">
<button ejs-button #textboxDiv cssClass="e-outline" (click)="textBox($event)" class="e-pv-e-sign-form-field-property">
<i class="e-icons e-text-form"></i>
<span style="font-size: 11px; margin-top: 6px;">Textbox</span>
</button>
<button ejs-button #passwordDiv cssClass="e-outline" (click)="password($event)" class="e-pv-e-sign-form-field-property">
<i class="e-icons e-password"></i>
<span style="font-size: 11px; margin-top: 6px;">Password</span>
</button>
</div>
<div style="display: flex;">
<button ejs-button #checkboxDiv cssClass="e-outline" (click)="checkBox($event)" class="e-pv-e-sign-form-field-property">
<i class="e-icons e-check-box"></i>
<span style="font-size: 11px; margin-top: 6px;">Checkbox</span>
</button>
<button ejs-button #radioButtonDiv cssClass="e-outline" (click)="radioButton($event)" class="e-pv-e-sign-form-field-property">
<i class="e-icons e-radio-button"></i>
<span style="font-size: 11px; margin-top: 6px;">Radio</span>
</button>
</div>
<div style="display: flex;">
<button ejs-button #dropDownDiv cssClass="e-outline" (click)="dropDown($event)" class="e-pv-e-sign-form-field-property">
<i class="e-icons e-drop-down"></i>
<span style="font-size: 11px; margin-top: 6px;">Dropdown</span>
</button>
<button ejs-button #listBoxDiv cssClass="e-outline" (click)="listBox($event)" class="e-pv-e-sign-form-field-property">
<i class="e-icons e-list-unordered"></i>
<span style="font-size: 11px; margin-top: 6px;">Listbox</span>
</button>
</div>
</div>
</ejs-sidebar>
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import { TestBed } from '@angular/core/testing';
import { RouterTestingModule } from '@angular/router/testing';
import { AppComponent } from './app.component';

describe('AppComponent', () => {
beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [
RouterTestingModule
],
declarations: [
AppComponent
],
}).compileComponents();
});

it('should create the app', () => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.componentInstance;
expect(app).toBeTruthy();
});

it(`should have as title 'attachpdf'`, () => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.componentInstance;
expect(app.title).toEqual('attachpdf');
});

it('should render title', () => {
const fixture = TestBed.createComponent(AppComponent);
fixture.detectChanges();
const compiled = fixture.nativeElement as HTMLElement;
expect(compiled.querySelector('.content span')?.textContent).toContain('attachpdf app is running!');
});
});
Loading