RFR: 8223717: javafx printing: Support Specifying Print to File in the API [v3]
Phil Race
prr at openjdk.java.net
Thu Jun 24 23:22:05 UTC 2021
On Thu, 24 Jun 2021 23:19:22 GMT, Kevin Rushforth <kcr at openjdk.org> wrote:
>> We aren't ignoring it .. its just handed on, so its going to be the same as the other non-writable case .. file could not be created .. printing error ..
>> we could do some up-front validation if that seems like the way we want to go. This could I guess also check if the file is writeable .. but since the user can select a non-writable file location in the dialog I don't think we should do that part. In which case I wonder about the URL validation too ..
>
> Consistency with other APIs would be the main reason. We could do something similar to what we do for `Image`, and treat a string without a protocol as a file (although not relative to the classpath as in the case of images), turning it into a `file:` URL internally where needed.
>
> @prrace what do you think?
> As a potential user of this API I have to ask, why would this be a URL instead of a File or Path ? Particularly if only "file:" URLs will be valid. I can't think of a scenario where it won't always be an extra inconvenience to convert the path I have to a URL.
I will think about it but not promising yet.
We only forsee (for now) a file .. We use URL a lot and also the javax.print API in 2D uses URL .. and so 2D hands us a file URL as well as expecting one .. and FX printing depends heavily on that right now so there's no escaping URLs somewhere.
-------------
PR: https://git.openjdk.java.net/jfx/pull/543
More information about the openjfx-dev
mailing list