question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Passing in formgroup element into viewer to allow for angular to populate fields

See original GitHub issue

Is your feature request related to a problem? Please describe. I really like the new form field fields feature. I have been trying to integrate this package into my company’s platform. We would like to get information from our database to populate the form fields in the PDF document.

Describe the solution you’d like When creating a reactive form in angular, the way to pass data into the pdf document is through a formgroup. Forms look like the code below. <form [formGroup]="reactiveForm" (ngSubmit)="onSubmit()" novalidate> It would be nice if we could pass in a formGroup from the component that hosts the pdf-viewer. Therefore it would be easy to pass in and save data from the pdf form.

Describe alternatives you’ve considered I tried to wrap the whole component with form tags, but that didn’t work. I am a junior dev. I am trying…

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:21 (13 by maintainers)

github_iconTop GitHub Comments

1reaction
textengcommented, Oct 17, 2020

This is what I got for my data.
Screenshot 2020-10-17 at 10 40 03 AM - Display 1 - Edited

If one looks at the input field in the control, the pdf field name can be found.
Screenshot 2020-10-17 at 10 48 35 AM - Display 1 - Edited I am pretty new to angular, and have only experimented with the pdf.js library recently. One could assume that we could take the attribute of the “name” field and create a formControlName field in the input field. I know it is more complicated than that, but maybe that helps.

The pdf used for testing. I modified to have the form fields named the way I want them to in acrobat. oklahoma-motor-vehicle-power-of-attorney-form modified.pdf

0reactions
stephanrauhcommented, Nov 7, 2020

The feature has landed with version 5.2.1, so I’ll close the ticket now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Reactive forms - Angular
The FormGroup directive listens for the submit event emitted by the form element and emits an ngSubmit event that you can bind to...
Read more >
FormGroup and FormControl in Angular
Learn how to use FormGroup and FormControl to build cleaner forms in Angular by dividing form controls into form groups.
Read more >
Working with Angular 4 Forms: Nesting and Input Validation
Forms in Angular applications can aggregate the state of all inputs that are under that form and provide an overall state like the...
Read more >
How to set value to form control in Reactive Forms in Angular
Note: It's mandatory to provide complete model structure for all form field controls within the FormGroup. If you miss any property or ...
Read more >
How to Use Angular FormArray(s) within FormGroup(s) In ...
Note the [formGroup] field with the name of the formGroup: companyForm. To access anything within this form, you will want to use ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found