expo-print: allow naming the PDF written by printToFileAsync
p
piotr.kuczynski@gmail.com
printToFileAsync always writes a generated file name, so an app that wants a meaningful PDF name (an invoice number, a report title) has to copy or move the file afterwards.
Request: an optional
fileName
in the options, on iOS and Android. A name is accepted only if it is a plain basename ending in .pdf
(^[A-Za-z0-9_-]+\.pdf$), the file is written to the cache directory, and the call fails when the destination already exists. When fileName
is omitted the behaviour is unchanged.I opened a PR with this: https://github.com/expo/expo/pull/52624 (the earlier GitHub issue, https://github.com/expo/expo/issues/52621, was closed by the triage bot as missing a repro, which does not apply to a feature request).