File tree Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Original file line number Diff line number Diff line change
1
+ const symbology6 = require ( './symbology6' ) ;
2
+
1
3
const parse = ( raf ) => {
2
4
const blockDivider = raf . readShort ( ) ;
3
5
const blockId = raf . readShort ( ) ;
6
+ // block id 6 is undocumented but appears to be text
7
+ if ( blockId === 6 ) return symbology6 ( raf ) ;
4
8
const blockLength = raf . readInt ( ) ;
5
9
6
10
// test some known values
Original file line number Diff line number Diff line change
1
+ // block id 6 is undocumented but appears to be text
2
+
3
+ const parse = ( raf ) => {
4
+ const pages = [ ] ;
5
+
6
+ // loop until a -1 is encounted
7
+ let length = raf . readShort ( ) ;
8
+ do {
9
+ while ( length !== - 1 ) {
10
+ pages . push ( raf . readString ( length ) ) ;
11
+ length = raf . readShort ( ) ;
12
+ }
13
+ length = raf . readShort ( ) ;
14
+ } while ( length === 80 ) ;
15
+
16
+ // roll back the 4 bytes used to detect the end of the text area
17
+ raf . skip ( - 4 ) ;
18
+
19
+ return { pages } ;
20
+ } ;
21
+
22
+ //
23
+
24
+ module . exports = parse ;
You can’t perform that action at this time.
0 commit comments