pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aaron Mulder <ammul...@gmail.com>
Subject Changing Font Cache File Directory
Date Sun, 29 May 2016 21:17:38 GMT
I see that the file that the font cache file is saved to a location
set by a system property.

I'm deploying my PDFBox app to OpenShift.  The font cache directory
should be set to the value of an environment variable in that
environment (or some offset from the path in the env var).  And, while
I can set the system property to the environment variable, it's a
one-time administrative action to change system properties, not
something that happens on every deployment.

e.g.:

$OPENSHIFT_DATA_DIR=/var/some/cryptic/dir/app-root/data/

I can set -Dpdfbox.fontcache=$OPENSHIFT_DATA_DIR but once I put that
in place, the value is fixed.  If $OPENSHIFT_DATA_DIR later changes
because they shuffle my VM or something, then the system property will
still refer to the old location until I figure out there's a problem
and go reset the system property.

Long story short, I'd like some way to programmatically set the font
cache directory, so I can run something like
FileSystemFontProvider.setDiskCacheFile(...) before I do anything else
with PDFBox.

Would you accept a patch to add that to FileSystemFontProvider?  Add a
property that defaults to null, and if set, its value takes priority
over the current logic to calculate the cache file?

Thanks,
       Aaron

P.S. Or, of course, if you want it to work automagically in OpenShift,
the patch could be to check for env var OPENSHIFT_DATA_DIR and put the
cache file there if that variable is defined.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org


Mime
View raw message