stchan/PdfScribe

Couldn't use environment variable in output filename

qwqVictor opened this issue · 7 comments

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.

bug confirmed

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.

Thank you the feature that I can run a batch file after the PDF is created is a breakthrough feature. Looking forward to it!

OK, Thank you.

see release v1.0.7