File tree Expand file tree Collapse file tree 3 files changed +24
-11
lines changed Expand file tree Collapse file tree 3 files changed +24
-11
lines changed Original file line number Diff line number Diff line change 1+ namespace PdfScribe
2+ {
3+ public enum NoDistillStripping : int
4+ {
5+ Searching ,
6+ Removing ,
7+ Complete
8+ }
9+ }
Original file line number Diff line number Diff line change 9999 <Compile Include =" ..\Common\PdfScribeSharedAssemblyInfo.cs" >
100100 <Link >PdfScribeSharedAssemblyInfo.cs</Link >
101101 </Compile >
102+ <Compile Include =" ConstantsEnums.cs" />
102103 <Compile Include =" GhostScript64.cs" />
103104 <Compile Include =" NativeMethods.cs" />
104105 <Compile Include =" Program.cs" />
Original file line number Diff line number Diff line change @@ -146,25 +146,28 @@ static void StripNoDistill(String postscriptFile)
146146 using ( StreamReader inputReader = new StreamReader ( File . OpenRead ( postscriptFile ) , System . Text . Encoding . UTF8 ) )
147147 using ( StreamWriter strippedWriter = new StreamWriter ( File . OpenWrite ( strippedFile ) , new UTF8Encoding ( false ) ) )
148148 {
149- bool redistillPhraseFound = false ;
149+ NoDistillStripping strippingStatus = NoDistillStripping . Searching ;
150150 String inputLine ;
151151 while ( ! inputReader . EndOfStream )
152152 {
153153 inputLine = inputReader . ReadLine ( ) ;
154154 if ( inputLine != null )
155155 {
156- if ( redistillPhraseFound )
156+ switch ( ( int ) strippingStatus )
157157 {
158- if ( inputLine == "%ADOEndClientInjection: DocumentSetup Start \" No Re-Distill\" " )
159- redistillPhraseFound = false ;
160- }
161- else
162- {
163- if ( inputLine == "%ADOBeginClientInjection: DocumentSetup Start \" No Re-Distill\" " )
164- redistillPhraseFound = true ;
165- else
158+ case ( int ) NoDistillStripping . Searching :
159+ if ( inputLine == "%ADOBeginClientInjection: DocumentSetup Start \" No Re-Distill\" " )
160+ strippingStatus = NoDistillStripping . Removing ;
161+ else
162+ strippedWriter . WriteLine ( inputLine ) ;
163+ break ;
164+ case ( int ) NoDistillStripping . Removing :
165+ if ( inputLine == "%ADOEndClientInjection: DocumentSetup Start \" No Re-Distill\" " )
166+ strippingStatus = NoDistillStripping . Complete ;
167+ break ;
168+ case ( int ) NoDistillStripping . Complete :
166169 strippedWriter . WriteLine ( inputLine ) ;
167-
170+ break ;
168171 }
169172 }
170173 }
You can’t perform that action at this time.
0 commit comments