File tree Expand file tree Collapse file tree 4 files changed +28
-0
lines changed
UglyToad.PdfPig.Tests/Integration
UglyToad.PdfPig/Parser/FileStructure Expand file tree Collapse file tree 4 files changed +28
-0
lines changed Original file line number Diff line number Diff line change 66 using PdfPig . Core ;
77 using PdfPig . Tokens ;
88 using SkiaSharp ;
9+ using UglyToad . PdfPig . AcroForms ;
10+ using UglyToad . PdfPig . AcroForms . Fields ;
911
1012 public class GithubIssuesTests
1113 {
14+ [ Fact ]
15+ public void Issue1208 ( )
16+ {
17+ string [ ] files = [ "Input.visible.pdf" , "Input.invisible.pdf" ] ;
18+
19+ foreach ( var file in files )
20+ {
21+ var path = IntegrationHelpers . GetSpecificTestDocumentPath ( file ) ;
22+
23+ using ( var document = PdfDocument . Open ( path , new ParsingOptions ( ) { UseLenientParsing = true } ) )
24+ {
25+ Assert . True ( document . TryGetForm ( out AcroForm form ) ) ;
26+ Assert . Single ( form . Fields ) ;
27+ Assert . Equal ( AcroFieldType . Signature , form . Fields [ 0 ] . FieldType ) ;
28+ }
29+ }
30+ }
31+
1232 [ Fact ]
1333 public void Revert_e11dc6b ( )
1434 {
Original file line number Diff line number Diff line change @@ -61,6 +61,9 @@ public static FirstPassResults Parse(
6161 }
6262 else
6363 {
64+ /* Code below commented to fix issue #1208, while not failing test Issue874
65+ * The logic would need to be reviewed before re-enabling.
66+
6467 // If we didn't brute force then use the previous position for ordering.
6568 foreach (var obj in streamsAndTables)
6669 {
@@ -81,6 +84,11 @@ public static FirstPassResults Parse(
8184 orderedXrefs.Add(obj);
8285 }
8386 }
87+ */
88+
89+ orderedXrefs . AddRange (
90+ streamsAndTables
91+ . OrderBy ( x => x . Offset ) ) ;
8492 }
8593
8694 DictionaryToken ? lastTrailer = null ;
You can’t perform that action at this time.
0 commit comments