title: Downloading to PDF in Angular with puppeter it is saving empty pdf
body: <p>I am trying to generate a PDF from the design I have in HTML.
  I am  working with <code>pupeeter</code> and backend <code>mongodb</code>
  I do have different templates in the frontend which they have different HTML.
  I have tried to save with <code>puppeeter</code> but I am not able to go further.
  Here is my code what I have tried.</p>
  <p><code>PDF Controller</code></p>
  <pre><code>const puppeteer = require('puppeteer');
  const fs = require('fs');
  
  module.exports =  {
      async  createPDF () {
    // launch a new chrome instance
    const browser = await puppeteer.launch({
      headless: true
    })
  
    // create a new page
    const page = await browser.newPage()
  
    // set your html as the pages content
    const html = fs.readFileSync(`${__dirname}/template.html`, 'utf8')
    // create a pdf buffer
    const pdfBuffer = await page.pdf({
      format: 'A4'
    })
  
    // or a .pdf file
    await page.pdf({
      format: 'A4',
      path: `${__dirname}/cv.pdf`
    })
  
    // close the browser
    await browser.close()
  }
  }
  
  routes.post(&quot;/pdf&quot;, PDFController.createPDF);
  </code></pre>
  <p>Service in FE.</p>
  <pre><code>@Injectable({providedIn: &quot;root&quot;})
  export class PdfService {
    public baseUrl = environment.backend;
  
  
    constructor(private http: HttpClient) {
    }
    public setPDF(data) {
      return this.http.post(`${this.baseUrl}/pdf`, data).subscribe(res =&gt; console.log(res));
    }
    getPdf() {
  
  
      const httpOptions = {
        responseType: &quot;blob&quot; as &quot;json&quot;,
  
      };
  
      return this.http.get(`${this.baseUrl}/help/cv`, httpOptions);
    }
  
  }
  </code></pre>
  <p>Here is my TS.</p>
  <pre><code>    public downloadPdf() {
      this.pdfService.setPDF(this.model);
   
        this.pdfService.getPdf().subscribe((data) =&gt; {
  
            console.log(data);
  
        });
  
    }
  </code></pre>
  <p>Here is my `HTML' code.</p>
  <pre><code>&lt;app-paginated-view [pageSize]=&quot;'A4'&quot; *ngIf=&quot;model &amp;&amp; model.theme === 'firstTemplate'&quot;
                        [pageNumbers]=&quot;model?.showPageNumbers&quot;
                        class=&quot;Grid-grid-column&quot; id=&quot;content&quot;
                        [style.color]=&quot;model.style?.color&quot;&gt;
      &lt;ng-container&gt;
        &lt;div class=&quot;Grid-grid-row&quot; pageContent (click)=&quot;setFirstCat()&quot; class=&quot;row&quot; #content
             [ngClass]=&quot;{ 'isCatActive': selectedFirstCat}&quot;&gt;
          &lt;div class=&quot;Grid-grid-column Grid-grid-column-12&quot;&gt;
            &lt;div class=&quot;Header-header-header Header-header-minHeight first-template-header&quot;&gt;
              &lt;div class=&quot;Title-title-titleWrapper first-template-titleWrapper&quot;&gt;
                &lt;h4 *ngIf=&quot;model?.hideName&quot;&gt;{{model.personalData[0].firstName}} {{model.personalData[0].lastName}}&lt;/h4&gt;
                &lt;h5&gt;{{model?.newJobTitle}}&lt;/h5&gt;
                &lt;div [innerHtml]=&quot;model?.description&quot;&gt;&lt;/div&gt;
              &lt;/div&gt;
              &lt;div class=&quot;Photo-photo-photoWrapper&quot; *ngIf=&quot;model?.showCVPhoto&quot;&gt;
                &lt;div class=&quot;Photo-photo-photo first-template-photo&quot;&gt;
                  &lt;img [src]=&quot;model?.photo&quot; height=&quot;100&quot; style=&quot;cursor:  pointer&quot;&gt;
                &lt;/div&gt;
              &lt;/div&gt;
            &lt;/div&gt;
            &lt;div *ngIf=&quot;selectedFirstCat&quot;&gt;
              &lt;div clickOutside (clickOutside)=&quot;removeClick()&quot;&gt;
                &lt;ul&gt;
                  &lt;li class=&quot;fa fa-pencil addIconTop&quot; (click)=&quot;editHeaderDialog({edit: true, model: model})&quot;&gt;&lt;/li&gt;
                  &lt;li class=&quot;fa fa-plus addIconBottom&quot; (click)=&quot;openDialog({model: model})&quot;&gt;&lt;/li&gt;
                &lt;/ul&gt;
              &lt;/div&gt;
            &lt;/div&gt;
          &lt;/div&gt;
        &lt;/div&gt;
      &lt;/ng-container&gt;
      &lt;ng-container class=&quot;Grid-grid-grid&quot;&gt;
        &lt;ng-container class=&quot;Unit-unit-unitGroup&quot; *ngFor=&quot;let personalData of model?.personalData; let id = index&quot;&gt;
          &lt;div pageContent *ngIf=&quot;personalData.visible&quot;&gt;
            &lt;div class=&quot;Unit-unit-unitGroup&quot; pageContent
                 [ngClass]=&quot;{ 'isCatActive': selectedCategory === category.PersonalData}&quot;&gt;
              &lt;div *ngIf=&quot;selectedCategory === category.PersonalData&quot;&gt;
                &lt;div clickOutside (clickOutside)=&quot;removeClick()&quot;&gt;
                  &lt;ul&gt;
                    &lt;li class=&quot;fa fa-plus addIconTop&quot; (click)=&quot;openDialog({model: model})&quot;&gt;&lt;/li&gt;
                    &lt;li class=&quot;fa fa-plus addIconBottom&quot; (click)=&quot;openDialog({model: model})&quot;&gt;&lt;/li&gt;
                    &lt;li class=&quot;fa fa-arrow-down moveIconDown&quot;&gt;&lt;/li&gt;
                    &lt;li class=&quot;fa fa-arrow-up moveIconTop&quot;&gt;&lt;/li&gt;
                  &lt;/ul&gt;
                &lt;/div&gt;
              &lt;/div&gt;
  
              &lt;div pageContent class=&quot;col-md-12&quot; (click)=&quot;setCategory(category.PersonalData)&quot;&gt;
                &lt;div class=&quot;row height&quot;&gt;
                  &lt;div class=&quot;col-md-4 col-sm-6 text-right tLine&quot; [style.background]=&quot;model.style.color&quot;&gt;&lt;/div&gt;
                  &lt;h3 class=&quot;first-template-paragraphTitle Paragraph-paragraph-title height&quot; [style.color]=&quot;model.style.color&quot;&gt;
                    &lt;div class=&quot;Text-text-wrapper&quot;&gt;
                      &lt;div class=&quot;Text-Text-text&quot; &gt;{{'category.PersonalData' | translate}}&lt;/div&gt;
                    &lt;/div&gt;
                  &lt;/h3&gt;
                &lt;/div&gt;
              &lt;/div&gt;
              &lt;div pageContent class=&quot;container-fluid&quot;&gt;
                &lt;app-personal-data [personalData]=&quot;personalData&quot; [model]=&quot;model&quot; [id]=&quot;id&quot;
                                   (deselectCategory)=&quot;test($event)&quot;&gt;
                &lt;/app-personal-data&gt;
              &lt;/div&gt;
            &lt;/div&gt;
          &lt;/div&gt;
        &lt;/ng-container&gt;
  
        &lt;!-- Career Component --&gt;
        &lt;ng-container *ngFor=&quot;let careers of model?.careers; let id = index&quot; class=&quot;Unit-unit-unitGroup&quot;&gt;
          &lt;div *ngIf=&quot;selectedCategory === category.Career&quot;&gt;
            &lt;div clickOutside (clickOutside)=&quot;removeClick()&quot;&gt;
              &lt;ul&gt;
                &lt;li class=&quot;fa fa-plus addIconTop&quot; (click)=&quot;openDialog({model: model})&quot;&gt;&lt;/li&gt;
                &lt;li class=&quot;fa fa-plus addIconBottom&quot; (click)=&quot;openDialog({model: model})&quot;&gt;&lt;/li&gt;
                &lt;button (click)=&quot;deleteCareerCategory(id)&quot; class=&quot;btn&quot;&gt;&lt;i
                  class=&quot;fa fa-trash deleteIconRight&quot;&gt;&lt;/i&gt;&lt;/button&gt;
                &lt;li class=&quot;fa fa-arrow-down moveIconDown&quot;&gt;&lt;/li&gt;
                &lt;li class=&quot;fa fa-arrow-up moveIconTop&quot;&gt;&lt;/li&gt;
              &lt;/ul&gt;
            &lt;/div&gt;
          &lt;/div&gt;
          &lt;div pageContent class=&quot;col-md-12&quot; (click)=&quot;setCategory(category.Career)&quot;&gt;
            &lt;div class=&quot;row height&quot;&gt;
              &lt;div class=&quot;col-md-4 col-sm-6 text-right tLine&quot; [style.background]=&quot;model.style.color&quot;&gt;&lt;/div&gt;
              &lt;h3 class=&quot;first-template-paragraphTitle Paragraph-paragraph-title height&quot; [style.color]=&quot;model.style.color&quot;&gt;
                &lt;div class=&quot;Text-text-wrapper&quot;&gt;
                  &lt;div class=&quot;Text-Text-text&quot;&gt;{{'category.Career' | translate}}&lt;/div&gt;
                &lt;/div&gt;
              &lt;/h3&gt;
            &lt;/div&gt;
          &lt;/div&gt;
          &lt;ng-container *ngFor=&quot;let careerObj of careers.subCategories; let i = index&quot;&gt;
            &lt;div pageContent class=&quot;container-fluid&quot;&gt;
              &lt;div pageContent [ngClass]=&quot;{ 'isActive': selectedCareerIndex === i}&quot;&gt;
                &lt;div class=&quot;Line-line-container&quot; (click)=&quot;setCareerIndex(i)&quot;&gt;
                  &lt;div class=&quot;Line-line-line&quot;&gt;
                    &lt;div class=&quot;Field-field-fieldBase first-template-fieldField&quot;&gt;
                      &lt;div class=&quot;Text-Text-wrapper&quot;&gt;
                        &lt;div pageContent class=&quot;Text-Text-text&quot;&gt;
                          {{careerObj.startDate | date:'MM/yyyy'}}
                          &lt;div class=&quot;float-right&quot; *ngIf=&quot;!careerObj.today&quot;&gt;{{careerObj.endDate | date:'MM/yyyy'}}&lt;/div&gt;
                          &lt;div class=&quot;float-right&quot; *ngIf=&quot;careerObj.today&quot;&gt;{{'career.present' | translate}}&lt;/div&gt;
                        &lt;/div&gt;
                      &lt;/div&gt;
                    &lt;/div&gt;
                    &lt;div class=&quot;Field-field-fieldBase first-template-fieldValue&quot;&gt;
                      &lt;div class=&quot;Text-Text-wrapper&quot;&gt;
                        &lt;div pageContent class=&quot;Text-Text-text-wrapper&quot;&gt;
                          &lt;b&gt;{{careerObj.role}}&lt;/b&gt;
                        &lt;/div&gt;
                      &lt;/div&gt;
                    &lt;/div&gt;
                    &lt;div class=&quot;Field-field-fieldBase first-template-fieldValue&quot;&gt;
                      &lt;div class=&quot;Text-Text-wrapper&quot;&gt;
                        &lt;div pageContent class=&quot;Text-Text-text-wrapper&quot;&gt;
                          {{careerObj.name}}
                        &lt;/div&gt;
                      &lt;/div&gt;
                    &lt;/div&gt;
                    &lt;div class=&quot;Field-field-fieldBase first-template-fieldValue&quot;&gt;
                      &lt;div class=&quot;Text-Text-wrapper&quot;&gt;
                        &lt;div pageContent class=&quot;Text-Text-text-wrapper&quot; aria-multiline=&quot;true&quot;
                             [innerHTML]=&quot;careerObj.description&quot;&gt;
                        &lt;/div&gt;
                      &lt;/div&gt;
                    &lt;/div&gt;
                    &lt;div class=&quot;Field-field-fieldBase first-template-fieldValue&quot; *ngIf=&quot;careerObj.showCompanyUrl&quot;&gt;
                      &lt;div class=&quot;Text-Text-wrapper&quot;&gt;
                        &lt;div pageContent class=&quot;Text-Text-text-wrapper&quot;&gt;
                          &lt;a target=&quot;_blank&quot; [href]=&quot;careerObj.companyUrl&quot;&gt;{{careerObj.companyUrl}}
                          &lt;/a&gt;
                        &lt;/div&gt;
                      &lt;/div&gt;
                    &lt;/div&gt;
  
                    &lt;ng-container pageContent *ngIf=&quot;selectedCareerIndex === i&quot;&gt;
                      &lt;div clickOutside (clickOutside)=&quot;removeClick()&quot;&gt;
                        &lt;ul&gt;
                          &lt;li class=&quot;fa fa-pencil addIconTop&quot;
                              (click)=&quot;editCareer({edit: true, career: careerObj, model: model})&quot;&gt;
                          &lt;/li&gt;
                          &lt;li class=&quot;fa fa-plus addIconBottom&quot;
                              (click)=&quot;addCareer({edit: false, model: model, career: false})&quot;&gt;&lt;/li&gt;
                          &lt;button [disabled]=&quot;careers.subCategories.length &lt; 2&quot; (click)=&quot;deleteCareerSubCategory(i)&quot;
                                  class=&quot;btn&quot;&gt;&lt;i class=&quot;fa fa-trash deleteIconRight&quot;&gt;&lt;/i&gt;&lt;/button&gt;
                          &lt;li class=&quot;fa fa-arrow-down moveIconDown&quot;&gt;&lt;/li&gt;
                          &lt;li class=&quot;fa fa-arrow-up moveIconTop&quot;&gt;&lt;/li&gt;
                        &lt;/ul&gt;
                      &lt;/div&gt;
                    &lt;/ng-container&gt;
                  &lt;/div&gt;
                &lt;/div&gt;
              &lt;/div&gt;
            &lt;/div&gt;
          &lt;/ng-container&gt;
          &lt;ng-container *ngFor=&quot;let emptyObj of careers.emptySubContents; let iEmpty = index&quot;&gt;
            &lt;app-empty-object pageContent [emptyObj]=&quot;emptyObj&quot; [iEmpty]=&quot;iEmpty&quot; [model]=&quot;model&quot; [isFromCareer]=&quot;true&quot;&gt;
            &lt;/app-empty-object&gt;
          &lt;/ng-container&gt;
        &lt;/ng-container&gt;
  
        &lt;!--Education Component--&gt;
        &lt;ng-container *ngFor=&quot;let education of model?.education; let index = index&quot; class=&quot;Unit-unit-unitGroup&quot;&gt;
          &lt;ng-container *ngIf=&quot;education.subCategories.length &gt; 0&quot;&gt;
            &lt;div *ngIf=&quot;selectedCategory === category.Education&quot;
                 [ngClass]=&quot;{ 'isCatActive': selectedCategory === category.Education}&quot;&gt;
              &lt;div clickOutside (clickOutside)=&quot;removeClick()&quot;&gt;
                &lt;ul&gt;
                  &lt;li class=&quot;fa fa-plus addIconTop&quot; (click)=&quot;openDialog({model: model})&quot;&gt;&lt;/li&gt;
                  &lt;li class=&quot;fa fa-plus addIconBottom&quot; (click)=&quot;openDialog({model: model})&quot;&gt;&lt;/li&gt;
                  &lt;li class=&quot;fa fa-trash deleteIconRight&quot; (click)=&quot;deleteEducationCategory(index)&quot;&gt;&lt;/li&gt;
                  &lt;li class=&quot;fa fa-arrow-down moveIconDown&quot;&gt;&lt;/li&gt;
                  &lt;li class=&quot;fa fa-arrow-up moveIconTop&quot;&gt;&lt;/li&gt;
                &lt;/ul&gt;
              &lt;/div&gt;
            &lt;/div&gt;
            &lt;div pageContent class=&quot;col-md-12&quot; (click)=&quot;setCategory(category.Education)&quot;&gt;
              &lt;div class=&quot;row height&quot;&gt;
                &lt;div class=&quot;col-md-4 col-sm-6 text-right tLine&quot; [style.background]=&quot;model.style.color&quot;&gt;&lt;/div&gt;
                &lt;h3 class=&quot;first-template-paragraphTitle Paragraph-paragraph-title height&quot;&gt;
                  &lt;div class=&quot;Text-text-wrapper&quot;&gt;
                    &lt;div class=&quot;Text-Text-text&quot;&gt;{{'category.Education' | translate}}&lt;/div&gt;
                  &lt;/div&gt;
                &lt;/h3&gt;
              &lt;/div&gt;
            &lt;/div&gt;
            &lt;ng-container *ngFor=&quot;let educationObj of education.subCategories; let i = index&quot;&gt;
              &lt;div pageContent class=&quot;container-fluid&quot;&gt;
                &lt;div pageContent [ngClass]=&quot;{ 'isActive': selectedIndex === i}&quot;&gt;
                  &lt;div pageContent class=&quot;Line-line-container&quot; (click)=&quot;setIndex(i)&quot;&gt;
                    &lt;div class=&quot;Line-line-line&quot;&gt;
                      &lt;div class=&quot;Field-field-fieldBase first-template-fieldField&quot;&gt;
                        &lt;div class=&quot;Text-Text-wrapper&quot;&gt;
                          &lt;div pageContent class=&quot;Text-Text-text&quot;&gt;
                            {{educationObj.startDate | date:'MM/yyyy'}}
                            &lt;div class=&quot;float-right&quot; *ngIf=&quot;!educationObj.today&quot;&gt;{{educationObj.endDate | date:'MM/yyyy'}}
                            &lt;/div&gt;
                            &lt;div class=&quot;float-right&quot; *ngIf=&quot;educationObj.today&quot;&gt;{{'present' | translate}}&lt;/div&gt;
                          &lt;/div&gt;
                        &lt;/div&gt;
                      &lt;/div&gt;
                    &lt;/div&gt;
                    &lt;div class=&quot;Field-field-fieldBase first-template-fieldValue&quot;&gt;
                      &lt;div class=&quot;Text-Text-wrapper&quot;&gt;
                        &lt;div class=&quot;Text-Text-text-wrapper&quot;&gt;
                          &lt;b&gt;{{educationObj.title}}&lt;/b&gt;
                        &lt;/div&gt;
                      &lt;/div&gt;
                    &lt;/div&gt;
                    &lt;div class=&quot;Field-field-fieldBase first-template-fieldValue&quot;&gt;
                      &lt;div class=&quot;Text-Text-wrapper&quot;&gt;
                        &lt;div class=&quot;Text-Text-text-wrapper&quot;&gt;
                          {{educationObj.name}}
                        &lt;/div&gt;
                      &lt;/div&gt;
                    &lt;/div&gt;
                    &lt;div class=&quot;Field-field-fieldBase first-template-fieldValue&quot;&gt;
                      &lt;div class=&quot;Text-Text-wrapper&quot;&gt;
                        &lt;div class=&quot;Text-Text-text-wrapper&quot; aria-multiline=&quot;true&quot; [innerHTML]=&quot;educationObj.description&quot;&gt;
                        &lt;/div&gt;
                      &lt;/div&gt;
                    &lt;/div&gt;
                    &lt;ng-container pageContent *ngIf=&quot;selectedIndex === i&quot;&gt;
                      &lt;div clickOutside (clickOutside)=&quot;removeClick()&quot;&gt;
                        &lt;ul&gt;
                          &lt;li class=&quot;fa fa-pencil addIconTop&quot;
                              (click)=&quot;editEducation({edit: true, education: educationObj, model: model})&quot;&gt;&lt;/li&gt;
                          &lt;button class=&quot;btn&quot;&gt;&lt;i class=&quot;fa fa-plus addIconBottom&quot;
                                                 (click)=&quot;addEducation({edit: false, model: model})&quot;&gt;&lt;/i&gt;&lt;/button&gt;
                          &lt;button [disabled]=&quot;education.subCategories.length === 1&quot;
                                  (click)=&quot;deleteEducationSubCategory(i)&quot; class=&quot;btn&quot;&gt;&lt;i
                            class=&quot;fa fa-trash deleteIconRight&quot;&gt;&lt;/i&gt;&lt;/button&gt;
                          &lt;li class=&quot;fa fa-arrow-down moveIconDown&quot;&gt;&lt;/li&gt;
                          &lt;li class=&quot;fa fa-arrow-up moveIconTop&quot;&gt;&lt;/li&gt;
                        &lt;/ul&gt;
                      &lt;/div&gt;
                    &lt;/ng-container&gt;
                  &lt;/div&gt;
                &lt;/div&gt;
              &lt;/div&gt;
              &lt;!--- &lt;app-education pageContent [educationObj]=&quot;educationObj&quot; [id]=&quot;i&quot; [education]=&quot;education&quot; [model]=&quot;model&quot;&gt;
                &lt;/app-education&gt; --&gt;
            &lt;/ng-container&gt;
          &lt;/ng-container&gt;
        &lt;/ng-container&gt;
  
  
        &lt;!-- Skills Component--&gt;
        &lt;ng-container *ngFor=&quot;let skills of model?.skills; let i = index&quot; class=&quot;Unit-unit-unitGroup&quot;&gt;
          &lt;div class=&quot;Unit-unit-unitGroup&quot; pageContent [ngClass]=&quot;{ 'isCatActive': selectedCategory === category.Skills}&quot;&gt;
            &lt;div *ngIf=&quot;selectedCategory === category.Skills&quot; (clickOutsideInner)=&quot;removeClick()&quot;&gt;
              &lt;div clickOutside (clickOutside)=&quot;removeClick()&quot;&gt;
                &lt;ul&gt;
                  &lt;li class=&quot;fa fa-plus addIconTop&quot; (click)=&quot;openDialog({model: model})&quot;&gt;&lt;/li&gt;
                  &lt;li class=&quot;fa fa-plus addIconBottom&quot; (click)=&quot;openDialog({model: model})&quot;&gt;&lt;/li&gt;
                  &lt;li class=&quot;fa fa-trash deleteIconRight&quot; (click)=&quot;deleteSkillsCategory(i)&quot;&gt;&lt;/li&gt;
                  &lt;li class=&quot;fa fa-arrow-down moveIconDown&quot;&gt;&lt;/li&gt;
                  &lt;li class=&quot;fa fa-arrow-up moveIconTop&quot;&gt;&lt;/li&gt;
                &lt;/ul&gt;
              &lt;/div&gt;
            &lt;/div&gt;
            &lt;div pageContent class=&quot;col-md-12&quot; (click)=&quot;setCategory(category.Skills)&quot;&gt;
              &lt;div class=&quot;row height&quot;&gt;
                &lt;div class=&quot;col-md-4 col-sm-6 text-right tLine&quot; [style.background]=&quot;model.style.color&quot;&gt;&lt;/div&gt;
                &lt;h3 class=&quot;first-template-paragraphTitle Paragraph-paragraph-title height&quot;&gt;
                  &lt;div class=&quot;Text-text-wrapper&quot;&gt;
                    &lt;div class=&quot;Text-Text-text&quot;&gt;{{'category.Skills' | translate}}&lt;/div&gt;
                  &lt;/div&gt;
                &lt;/h3&gt;
              &lt;/div&gt;
            &lt;/div&gt;
            &lt;div pageContent class=&quot;container-fluid&quot;&gt;
              &lt;ng-container *ngFor=&quot;let skillObj of skills.subCategories; let i = index&quot; class=&quot;col-md-12&quot;&gt;
                &lt;app-skills pageContent [skillObj]=&quot;skillObj&quot; [id]=&quot;i&quot; [skills]=&quot;skills&quot; [model]=&quot;model&quot;&gt;&lt;/app-skills&gt;
              &lt;/ng-container&gt;
            &lt;/div&gt;
          &lt;/div&gt;
        &lt;/ng-container&gt;
        &lt;!-- Files Component --&gt;
        &lt;ng-container *ngFor=&quot;let file of model?.files; let index = index&quot; class=&quot;Unit-unit-unitGroup&quot;&gt;
  
          &lt;div *ngIf=&quot;selectedCategory === category.Files&quot;
               [ngClass]=&quot;{ 'isCatActive': selectedCategory === category.Files}&quot;&gt;
            &lt;div clickOutside (clickOutside)=&quot;removeClick()&quot;&gt;
              &lt;ul&gt;
                &lt;li class=&quot;fa fa-plus addIconTop&quot; (click)=&quot;openDialog({model:model})&quot;&gt;&lt;/li&gt;
                &lt;li class=&quot;fa fa-plus addIconBottom&quot; (click)=&quot;openDialog({model: model})&quot;&gt;&lt;/li&gt;
                &lt;li class=&quot;fa fa-trash deleteIconRight&quot; (click)=&quot;deleteEducationCategory(index)&quot;&gt;&lt;/li&gt;
                &lt;li class=&quot;fa fa-arrow-down moveIconDown&quot;&gt;&lt;/li&gt;
                &lt;li class=&quot;fa fa-arrow-up moveIconTop&quot;&gt;&lt;/li&gt;
              &lt;/ul&gt;
            &lt;/div&gt;
          &lt;/div&gt;
          &lt;div pageContent class=&quot;col-md-12&quot; (click)=&quot;setCategory(category.Files)&quot;&gt;
            &lt;div class=&quot;row height&quot;&gt;
              &lt;div class=&quot;col-md-4 col-sm-6 text-right tLine&quot; [style.background]=&quot;model.style.color&quot;&gt;&lt;/div&gt;
              &lt;h3 class=&quot;first-template-paragraphTitle Paragraph-paragraph-title height&quot;&gt;
                &lt;div class=&quot;Text-text-wrapper&quot;&gt;
                  &lt;div class=&quot;Text-Text-text&quot;&gt;{{'category.Files' | translate}}&lt;/div&gt;
                &lt;/div&gt;
              &lt;/h3&gt;
            &lt;/div&gt;
          &lt;/div&gt;
          &lt;ng-container *ngFor=&quot;let fileObj of file.subCategories; let i = index&quot; class=&quot;col-md-12&quot;&gt;
            &lt;div pageContent class=&quot;container-fluid&quot;&gt;
              &lt;div pageContent [ngClass]=&quot;{ 'isActive': selectedFileIndex === i}&quot;&gt;
                &lt;div pageContent class=&quot;Line-line-container&quot; (click)=&quot;setFileIndex(i)&quot;&gt;
                  &lt;div class=&quot;Line-line-line&quot;&gt;
                    &lt;div class=&quot;Field-field-fieldBase first-template-fieldField&quot;&gt;
                      &lt;div pageContent class=&quot;Text-Text-wrapper&quot;&gt;
                        &lt;div class=&quot;Text-Text-text&quot;&gt;
                          {{fileObj.name}}&lt;/div&gt;
                      &lt;/div&gt;
                    &lt;/div&gt;
                  &lt;/div&gt;
                  &lt;div class=&quot;Field-field-fieldBase first-template-fieldValue&quot; *ngIf=&quot;fileObj.link&quot;&gt;
                    &lt;div class=&quot;Text-Text-wrapper&quot;&gt;
                      &lt;div class=&quot;Text-Text-text-wrapper&quot;&gt;
                        &lt;a target=&quot;_blank&quot; [href]=&quot;fileObj.link&quot;&gt;{{fileObj.link}}
                        &lt;/a&gt;
                      &lt;/div&gt;
                    &lt;/div&gt;
                  &lt;/div&gt;
                  &lt;div class=&quot;Field-field-fieldBase first-template-fieldValue&quot;&gt;
                    &lt;div class=&quot;Text-Text-wrapper&quot;&gt;
                      &lt;div class=&quot;Text-Text-text-wrapper&quot; aria-multiline=&quot;true&quot; [innerHTML]=&quot;fileObj.description&quot;&gt;
                      &lt;/div&gt;
                    &lt;/div&gt;
                  &lt;/div&gt;
                  &lt;ng-container pageContent *ngIf=&quot;selectedFileIndex === i&quot;&gt;
                    &lt;div clickOutside (clickOutside)=&quot;removeClick()&quot;&gt;
                      &lt;ul&gt;
                        &lt;li class=&quot;fa fa-pencil addIconTop&quot; (click)=&quot;editFile({edit: true, file: fileObj, model: model})&quot;&gt;
                        &lt;/li&gt;
                        &lt;button (click)=&quot;addFile({edit: false, model: model})&quot; class=&quot;btn&quot;&gt;&lt;i
                          class=&quot;fa fa-plus addIconBottom&quot;&gt;&lt;/i&gt;&lt;/button&gt;
                        &lt;button [disabled]=&quot;file.subCategories.length === 1&quot; (click)=&quot;deleteSubFile(i)&quot; class=&quot;btn&quot;&gt;&lt;i
                          class=&quot;fa fa-trash deleteIconRight&quot;&gt;&lt;/i&gt;&lt;/button&gt;
                        &lt;li class=&quot;fa fa-arrow-down moveIconDown&quot;&gt;&lt;/li&gt;
                        &lt;li class=&quot;fa fa-arrow-up moveIconTop&quot;&gt;&lt;/li&gt;
                      &lt;/ul&gt;
                    &lt;/div&gt;
                  &lt;/ng-container&gt;
                &lt;/div&gt;
              &lt;/div&gt;
            &lt;/div&gt;
          &lt;/ng-container&gt;
        &lt;/ng-container&gt;
        &lt;!-- Empty Category --&gt;
        &lt;ng-container *ngFor=&quot;let emptyCat of model?.emptyCategory; let i = index&quot; class=&quot;Unit-unit-unitGroup&quot;&gt;
          &lt;div *ngIf=&quot;selectedCategory === category.Another&quot;
               [ngClass]=&quot;{ 'isCatActive': selectedCategory === category.Another}&quot;&gt;
            &lt;div clickOutside (clickOutside)=&quot;removeClick()&quot;&gt;
              &lt;ul&gt;
                &lt;li class=&quot;fa fa-pencil addIconTop&quot;
                    (click)=&quot;editEmptyCategory({edit: true, model: model, emptyCategory: emptyCat})&quot;&gt;&lt;/li&gt;
                &lt;li class=&quot;fa fa-plus addIconBottom&quot; (click)=&quot;openDialog({model: model})&quot;&gt;&lt;/li&gt;
                &lt;li class=&quot;fa fa-trash deleteIconRight&quot; (click)=&quot;deleteEmptyCategory(i)&quot;&gt;&lt;/li&gt;
                &lt;li class=&quot;fa fa-arrow-down moveIconDown&quot;&gt;&lt;/li&gt;
                &lt;li class=&quot;fa fa-arrow-up moveIconTop&quot;&gt;&lt;/li&gt;
              &lt;/ul&gt;
            &lt;/div&gt;
          &lt;/div&gt;
          &lt;div pageContent class=&quot;col-md-12&quot; (click)=&quot;setCategory(category.Another)&quot;&gt;
            &lt;div class=&quot;row height&quot;&gt;
              &lt;div class=&quot;col-md-4 col-sm-6 text-right tLine&quot; [style.background]=&quot;model.style.color&quot;&gt;&lt;/div&gt;
              &lt;h3 class=&quot;first-template-paragraphTitle Paragraph-paragraph-title height&quot;&gt;
                &lt;div class=&quot;Text-text-wrapper&quot;&gt;
                  &lt;div class=&quot;Text-Text-text&quot;&gt;{{emptyCat.name}}&lt;/div&gt;
                &lt;/div&gt;
              &lt;/h3&gt;
            &lt;/div&gt;
          &lt;/div&gt;
          &lt;ng-container *ngFor=&quot;let emptySubObj of emptyCat.emptySubContents; let i = index&quot; class=&quot;col-md-12&quot;&gt;
            &lt;div pageContent class=&quot;container-fluid&quot;&gt;
              &lt;div pageContent [ngClass]=&quot;{ 'isActive': selectedEmptySubCat === i}&quot;&gt;
                &lt;div pageContent class=&quot;Line-line-container&quot; (click)=&quot;setEmptySubCatIndex(i)&quot;&gt;
                  &lt;div class=&quot;Line-line-line&quot;&gt;
                    &lt;div class=&quot;Field-field-fieldBase first-template-fieldField&quot;&gt;
                      &lt;div class=&quot;Text-Text-wrapper&quot;&gt;
                        &lt;div pageContent class=&quot;Text-Text-text&quot;&gt;
                          {{emptySubObj.name}}&lt;/div&gt;
                      &lt;/div&gt;
                    &lt;/div&gt;
                  &lt;/div&gt;
                  &lt;div class=&quot;Field-field-fieldBase first-template-fieldValue&quot;&gt;
                    &lt;div class=&quot;Text-Text-wrapper&quot;&gt;
                      &lt;div pageContent class=&quot;Text-Text-text-wrapper&quot; aria-multiline=&quot;true&quot;
                           [innerHTML]=&quot;emptySubObj.description&quot;&gt;
                      &lt;/div&gt;
                    &lt;/div&gt;
                  &lt;/div&gt;
                  &lt;ng-container pageContent *ngIf=&quot;selectedEmptySubCat === i&quot;&gt;
                    &lt;div clickOutside (clickOutside)=&quot;removeClick()&quot;&gt;
                      &lt;ul&gt;
                        &lt;li class=&quot;fa fa-pencil addIconTop&quot;
                            (click)=&quot;editEmptySubCat({edit: true, empty: emptySubObj, model: model, emptySubCat: true})&quot;&gt;
                        &lt;/li&gt;
                        &lt;button (click)=&quot;addEmptySubCat({edit: false, model: model, emptySubCat: true})&quot; class=&quot;btn&quot;&gt;&lt;i
                          class=&quot;fa fa-plus addIconBottom&quot;&gt;&lt;/i&gt;&lt;/button&gt;
                        &lt;button [disabled]=&quot;emptyCat.emptySubContents.length === 1&quot; (click)=&quot;deleteEmptyCatFile(i)&quot;
                                class=&quot;btn&quot;&gt;&lt;i class=&quot;fa fa-trash deleteIconRight&quot;&gt;&lt;/i&gt;&lt;/button&gt;
                        &lt;li class=&quot;fa fa-arrow-down moveIconDown&quot;&gt;&lt;/li&gt;
                        &lt;li class=&quot;fa fa-arrow-up moveIconTop&quot;&gt;&lt;/li&gt;
                      &lt;/ul&gt;
                    &lt;/div&gt;
                  &lt;/ng-container&gt;
                &lt;/div&gt;
              &lt;/div&gt;
            &lt;/div&gt;
          &lt;/ng-container&gt;
        &lt;/ng-container&gt;
        &lt;!--Here closes the container for the whole page--&gt;
      &lt;/ng-container&gt;
      &lt;div class=&quot;PageNumber-page-number-container&quot;&gt;
        &lt;div class=&quot;PageNumber-page-number-pageNumber&quot;&gt;
          &lt;span class=&quot;PageNumber-page-number-page&quot;&gt;
            Page
          &lt;/span&gt;
          &lt;span&gt;1 / 2&lt;/span&gt;
        &lt;/div&gt;
      &lt;/div&gt;
  
    &lt;/app-paginated-view&gt;
  </code></pre>
  <p>I am based on this page here how they download the PDF.</p>
  <p><a href="https://lebenslauf.com/" rel="nofollow noreferrer">https://lebenslauf.com/</a></p>
  <p>They take the design which is in the Frontend and they can download pdf within the design and date they have given in the UI.
  Is it something possible to do like that?
  In my PDF I cannot copy text or edit a text and the <code>image</code> or PDF it is very small.</p>
  <p>I can add more code or to explain it better if someone does not understand
  See the attached photos how the pdf looks like.
  I have resized in google chrome just only to see better but instead it is a normal font as A4 page.</p>
  <p>And this is the photo how my UI looks like.</p>
  <p><a href="https://i.stack.imgur.com/jfYgB.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jfYgB.png" alt="enter image description here" /></a></p>