The viewer can open all other document types when it's set on the server-side only. I guess you allowed OpenLocalPdf permission for the viewer because it's not allowed by default. The viewer can open only PDF files when invoked on the client-side.
> I know that the viewer converts every document to PDF but my customer does not know that.
So what you should do it is to remove OpenLocalPdf permission and put a file upload input on your page, allow the user to upload and then open that file with the viewer on the server-side. This is how we do it in our live demo, we have a component named ExampleFileSelector for this. Maybe in future versions, we should include this upload and convert behaviour inside the viewer for convenience.
> How can I translate the message "Invalid PDF structure" to Dutch, everthing else is already in Dutch?
Yes it's internal message which is displayed in the textbox for extra details but the title of the dialog already describes the problem with localized text.
But what we can do is, maybe we should filter files for .PDF extension only for browser's file picker dialog.
From Version 7.1.0 - September 1, 2024 release notes:
Added: New permission DocumentViewerPermissions.OpenLocalPdf:
Ability to open local PDF files, i.e. user is shown "Open" menu item which is when clicked shows browser's open dialog to choose a PDF file to load.
This permission is not included in All permission so it should be added additionally:
C#
//allow all set of permissions and also add OpenLocalPdf which is not included in all
documentViewer.AllowedPermissions = DocumentViewerPermissions.All | DocumentViewerPermissions.OpenLocalPdf;
Note that only PDF files can be opened this way and not other formats because file is not processed on the server side (no conversions),
and it's loaded by client-side DocumentViewer directly (same for attachments, non-PDF attachments will trigger download only and not load).
However, it can be useful to test quickly, how a specific PDF file is rendered in the DocumentViewer.