Hello everyone.
I'm developing a custom print component using the PrintViewModel and PrintTemplate, with TypeScript.
When creating an instance of PrintTemplate and trying to set in layout a custom layout string from my ArcGIS Enteprise, TypeScript raises an error, saying layout's only possible values are: "map-only"|"a3-landscape"|"a3-portrait"|"a4-landscape"|"a4-portrait"|"letter-ansi-a-landscape"|"letter-ansi-a-portrait"|"tabloid-ansi-b-landscape"|"tabloid-ansi-b-portrait".
In the documentation (PrintTemplate | API Reference | ArcGIS Maps SDK for JavaScript 4.28 | ArcGIS Developers ) it says that "the server administrator can add additional templates to the print service". We've published custom templates in our Enterprise but can set the layout string in the PrintTemplate.
I found this old post for an old API version, saying it was solved, but I still have the issue in 4.28. (1) Solved: JS API 4.15: Print template issue - Esri Community
What makes me believe this is an error or bug is that I analyzed the requests sent by the default print widget and the custom template name is sent in that property. Also, if I trick TypeScript putting: "layout: "My_Custom_Template" as 'map-only'" in my code, everything works fine.
This workaround solves the issue for now, but I would like to find a more elegant solution.
Thank you in advance!