I know this seems like a duplicate question to this one 'kendo-angular-pdf-export' is not a known element
But I have an angular 14 app where I want to simply add the PDFExportModule into an existing application.
I am currently getting this error:
Error: src/app/pages/reports/meeting-report.component.html:20:1 - error NG8001: 'kendo-pdf-export' is not a known element:
1. If 'kendo-pdf-export' is an Angular component, then verify that it is part of this module.
2. If 'kendo-pdf-export' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.
As a POC, I created a brand new application and followed instructions from here: https://www.telerik.com/kendo-angular-ui/components/pdf-export/get-started/
New Project Ran this code
ng add @progress/kendo-angular-pdf-export
Package was added to package.json
"@progress/kendo-angular-pdf-export": "^12.0.0",
I added the PDFExportModule to the app.modules.ts
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { PDFExportModule } from '@progress/kendo-angular-pdf-export';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
AppRoutingModule,
PDFExportModule,
BrowserAnimationsModule
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
I added this snippet to the app.component.html
<kendo-pdf-export #pdf paperSize="A4" margin="2cm">
content to be exported
</kendo-pdf-export>
<div class="example-config">
<button kendoButton (click)="pdf.saveAs('my_document.pdf')">
Save As PDF...
</button>
</div>
In the new app, HTML renders and the PDF export works!!
Why might my existing app not be picking up on the export module? And suggestions would be greatly appreciated!