[ADF-3443] basic printing support (#3777)

* printing service

* code fixes

* update code
This commit is contained in:
Denys Vuika
2018-09-12 13:04:43 +01:00
committed by Eugenio Romano
parent 3857364b39
commit c5c1aa9ecb
5 changed files with 183 additions and 2 deletions

View File

@@ -30,6 +30,7 @@ import { ViewerOpenWithComponent } from './viewer-open-with.component';
import { ViewerSidebarComponent } from './viewer-sidebar.component';
import { ViewerToolbarComponent } from './viewer-toolbar.component';
import { Subscription } from 'rxjs';
import { ViewUtilService } from '../services/view-util.service';
@Component({
selector: 'adf-viewer',
@@ -245,6 +246,7 @@ export class ViewerComponent implements OnChanges, OnInit, OnDestroy {
};
constructor(private apiService: AlfrescoApiService,
private viewUtils: ViewUtilService,
private logService: LogService,
private location: Location,
private el: ElementRef) {
@@ -588,6 +590,10 @@ export class ViewerComponent implements OnChanges, OnInit, OnDestroy {
if (this.allowPrint) {
const args = new BaseEvent();
this.print.next(args);
if (!args.defaultPrevented) {
this.viewUtils.printFileGeneric(this.nodeId, this.mimeType);
}
}
}