Couldn't use environment variable in output filename
qwqVictor opened this issue · 7 comments
qwqVictor commented
The PdfScribe.exe.config
is that:
<?xml version="1.0"?>
<configuration>
<configSections>
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="PdfScribe.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</sectionGroup>
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
</startup>
<system.diagnostics>
<trace autoflush="true" />
<sources>
<source name="PdfScribe"
switchName="PdfScribeAll" >
<listeners>
<add name="textwriterListener"
type="System.Diagnostics.TextWriterTraceListener"
initializeData="PdfScribe_trace.log"
traceOutputOptions="DateTime" />
<remove name="Default" />
<clear /> <!-- Remove the <clear /> element to turn on tracing output -->
</listeners>
</source>
</sources>
<switches>
<add name="PdfScribeAll" value="Verbose"/>
</switches>
</system.diagnostics>
<applicationSettings>
<PdfScribe.Properties.Settings>
<setting name="OutputFile" serializeAs="String">
<value>C:\Temp\TEMP_%RAND%.PDF</value>
</setting>
<setting name="AskUserForOutputFilename" serializeAs="String">
<value>False</value>
</setting>
<setting name="OpenAfterCreating" serializeAs="String">
<value>True</value>
</setting>
</PdfScribe.Properties.Settings>
</applicationSettings>
</configuration>
The environment variable RAND
is my custom system environment variable. It does not contain any illegal characters, but PdfScribe couldn't save the PDF and threw out an error called -100.
stchan commented
bug confirmed
qwqVictor commented
Looking forward to a new release with this bug fixed.
In addition, why not add an option for using random filename? Or define a placeholder such as :RANDOM:
which means random string? This could be helpful in order not to overwrite the file.
stchan commented
Generally I want to keep PdfScribe a basic, reliable tool - I've been slow
to add features to avoid expanding its scope without deliberating over why
particular changes would be desirable. Do check out some of the forks
people have created (I like to believe the simplicity of the project
encourages people to customize it for their needs - there's not a lot of
code to digest) - while I haven't browsed them for a while, there's at
least one that has an option to run a batch file after the PDF is created -
maybe you could use that to rename files randomly. Or, maybe create your
own fork that does exactly what you need.
…On Tue, May 21, 2019 at 12:50 AM Victor Huang ***@***.***> wrote:
Looking forward to a new release with this bug fixed.
In addition, why not add an option for using random filename? Or define a
placeholder such as :RANDOM: which means random string? This could be
helpful in order not to overwrite the file.
—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub
<#13?email_source=notifications&email_token=AAJS3JTHCO3TDDWRIJX42M3PWN5QZA5CNFSM4HOGRZO2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODV2XUJI#issuecomment-494238245>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAJS3JST7U7DH72OZ4LTXI3PWN5QZANCNFSM4HOGRZOQ>
.
qwqVictor commented
Thank you the feature that I can run a batch file after the PDF is created is a breakthrough feature. Looking forward to it!
stchan commented
I think you may have misunderstood - I meant one of the forks has this
feature - I'm not planning on adding it.
Look here:
https://github.com/matthewgregg/PdfScribe
…On Tue, May 21, 2019 at 2:07 AM Victor Huang ***@***.***> wrote:
Thank you the feature that I can run a batch file after the PDF is created
is a breakthrough feature. Looking forward to it!
—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub
<#13?email_source=notifications&email_token=AAJS3JTXZYLFXHK4TKDL7BLPWOGTZA5CNFSM4HOGRZO2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODV23GJY#issuecomment-494252839>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAJS3JUCJMTQ4U3RSX4ZOI3PWOGTZANCNFSM4HOGRZOQ>
.
qwqVictor commented
OK, Thank you.
stchan commented
see release v1.0.7