Skip to content

Commit 07172b7

Browse files
alignment issue fix.
1 parent 40d19eb commit 07172b7

File tree

1 file changed

+24
-24
lines changed

1 file changed

+24
-24
lines changed

find-corrupted-pdf-file-demo/Program.cs

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -11,31 +11,31 @@ class Program
1111
static void Main(string[] args)
1212
{
1313
//Load the PDF file as stream
14-
using (FileStream pdfStream = new FileStream(@"..\..\..\PDF-Files\input-open-repair.pdf", FileMode.Open, FileAccess.Read))
15-
{
16-
//Create a new instance of PDF document syntax analyzer.
17-
PdfDocumentAnalyzer analyzer = new PdfDocumentAnalyzer(pdfStream);
18-
//Analyze the syntax and return the results
19-
SyntaxAnalyzerResult analyzerResult = analyzer.AnalyzeSyntax();
14+
using (FileStream pdfStream = new FileStream(@"..\..\..\PDF-Files\input-open-repair.pdf", FileMode.Open, FileAccess.Read))
15+
{
16+
//Create a new instance of PDF document syntax analyzer.
17+
PdfDocumentAnalyzer analyzer = new PdfDocumentAnalyzer(pdfStream);
18+
//Analyze the syntax and return the results
19+
SyntaxAnalyzerResult analyzerResult = analyzer.AnalyzeSyntax();
2020

21-
//Check whether the document is corrupted or not
22-
if (analyzerResult.IsCorrupted)
23-
{
24-
StringBuilder strBuilder = new StringBuilder();
25-
strBuilder.AppendLine("The PDF document is corrupted.");
26-
int count = 1;
27-
foreach (PdfException exception in analyzerResult.Errors)
28-
{
29-
strBuilder.AppendLine(count++.ToString() + ": " + exception.Message);
30-
}
31-
Console.WriteLine(strBuilder);
32-
}
33-
else
34-
{
35-
Console.WriteLine("No syntax error found in the provided PDF document");
36-
}
37-
analyzer.Close();
38-
}
21+
//Check whether the document is corrupted or not
22+
if (analyzerResult.IsCorrupted)
23+
{
24+
StringBuilder strBuilder = new StringBuilder();
25+
strBuilder.AppendLine("The PDF document is corrupted.");
26+
int count = 1;
27+
foreach (PdfException exception in analyzerResult.Errors)
28+
{
29+
strBuilder.AppendLine(count++.ToString() + ": " + exception.Message);
30+
}
31+
Console.WriteLine(strBuilder);
32+
}
33+
else
34+
{
35+
Console.WriteLine("No syntax error found in the provided PDF document");
36+
}
37+
analyzer.Close();
38+
}
3939
}
4040
}
4141
}

0 commit comments

Comments
 (0)