This seems to be more of a fix than new feature. When exporting PDFs from Revit 2022+ if the name includes any characters (/\:*?"<>| ) that can't be included file names an exception is thrown. Some of these characters are acceptable in view or sheet names in Revit and should be safe to export as PDFs. This is inconsistent with the behaviour in the UI (the files are renamed) and other areas of the Revit API. For example when exporting images from Revit with the API, Image Export Options handles this renaming, the illegal characters are replaced automatically. It even provides a helpful method to get the safe name for the exported file!
ImageExportOptions.GetFileName(document, viewId)
// Gets the file name that will be produced when exporting a view to an image.
// This is the name after Revit handles replacing illegal characters!
Thanks.
Can't find what you're looking for? Ask the community or share your knowledge.