Enhancement: use basename of output file as PDF title
Posted: 2010-12-28T16:28:37-07:00
Attached is a patch that will let the pdf coder use the basename of the output file as the PDF title rather than the entire path of the output file. It appears to work fine on Mac OS X 10.6.5, unsure if it will work on other OSen (mainly the "#include <libgen.h>"), it may need some work there.
----- begin base64 encoded patch -----
LS0tIGNvZGVycy9wZGYuYy5vcmlnCTIwMTAtMDYtMDIgMTc6NTM6MDYuMDAwMDAw
MDAwIC0wNzAwCisrKyBjb2RlcnMvcGRmLmMJMjAxMC0xMi0yOCAxNDo1MjoyNS4w
MDAwMDAwMDAgLTA4MDAKQEAgLTczLDYgKzczLDkgQEAKICNpbmNsdWRlICJtYWdp
Y2svdHJhbnNmb3JtLmgiCiAjaW5jbHVkZSAibWFnaWNrL3V0aWxpdHkuaCIKICNp
bmNsdWRlICJtYWdpY2svbW9kdWxlLmgiCisjaWZkZWYJVVNFX0ZJTEVfQkFTRU5B
TUVfQVNfUERGX1RJVExFCisjIGluY2x1ZGUgPGxpYmdlbi5oPgorI2VuZGlmCS8q
IFVTRV9GSUxFX0JBU0VOQU1FX0FTX1BERl9USVRMRSAqLwogDAogLyoKICAgRGVm
aW5lIGRlY2xhcmF0aW9ucy4KQEAgLTk0Nyw2ICs5NTAsMTAgQEAKICAgICAqKmxh
YmVscywKICAgICBwYWdlX2dlb21ldHJ5W01heFRleHRFeHRlbnRdOwogCisjaWZk
ZWYJVVNFX0ZJTEVfQkFTRU5BTUVfQVNfUERGX1RJVExFCisgIGNoYXIJKnBkZlRp
dGxlU3RyaW5nID0gTlVMTDsKKyNlbmRpZgkvKiBVU0VfRklMRV9CQVNFTkFNRV9B
U19QREZfVElUTEUgKi8KKwogICBDb21wcmVzc2lvblR5cGUKICAgICBjb21wcmVz
c2lvbjsKIApAQCAtMjQ5MSw4ICsyNDk4LDI4IEBACiAgICAgb2JqZWN0KTsKICAg
KHZvaWQpIFdyaXRlQmxvYlN0cmluZyhpbWFnZSxidWZmZXIpOwogICAodm9pZCkg
V3JpdGVCb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