Altinn / Altinn/app-lib-dotnet
Custom (and automatic) PDF layouts hides most of our components
- Dominant language
- C#
- Stars
- 8
- Forks
- 27
- Avg merge
- 1h 21m
- Merged PRs (30d)
- 7
Description
### Description of the bug
We have a form that defines a custom PDF layout. When the user submits the form, most of the components in that pdf layout become hidden although none of the components in the layout file have set the hidden property.
Here is the PDF layout generated with DevTools just before clicking "Send inn".

And here is the PDF that is actually generated after submitting the form.

All components that are of type Summary, are hidden.
### Steps To Reproduce
1. Go to [Repo](https://altinn.studio/repos/sfvt/dgm-ansvarlig)
2. Clone and start the project: `dotnet run` in `./src/Digdir.Dgm.Gravferden.Api.Fake` and `dotnet run` in a separate command line window in `./App`
3. Fill out the form.
4. on the summary page, open Altinn developer tools, and click "Generer PDF"
5. Observe that the values of the pdf layout are present.
6. Click "Send inn", and observe that the provided PDF only shows the components from the custom pdf layout that are not SummaryComponents.
### Additional Information
If you want to test this locally with the latest version of the frontend, you need to remove the `JsonEnumConverter` option on line 84-86 in `Program.cs`
```cs
// Comment this out
options.JsonSerializerOptions.Converters.Add(
new JsonStringEnumConverter(JsonNamingPolicy.CamelCase)
);
```
Contributor guide
Research direction
Reproduce the issue using ./src/Digdir.Dgm.Gravferden.Api.Fake and ./App with dotnet run, then compare the PDF generated before submission with the submitted PDF. Check the JSON enum configuration around Program.cs lines 84-86 and trace the custom PDF layout through submission; done means SummaryComponents and the other layout components remain visible in the submitted PDF.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- full-stack
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100