File tree Expand file tree Collapse file tree 2 files changed +7
-13
lines changed Expand file tree Collapse file tree 2 files changed +7
-13
lines changed Original file line number Diff line number Diff line change @@ -558,20 +558,9 @@ var PDFDoc = (function pdfDoc() {
558
558
var properties = data [4 ];
559
559
560
560
if (file ) {
561
+ // Rewrap the ArrayBuffer in a stream.
561
562
var fontFileDict = new Dict ();
562
- fontFileDict .map = file .dict .map ;
563
-
564
- var fontFile = new Stream (file .bytes , file .start ,
565
- file .end - file .start , fontFileDict );
566
-
567
- // Check if this is a FlateStream. Otherwise just use the created
568
- // Stream one. This makes complex_ttf_font.pdf work.
569
- var cmf = file .bytes [0 ];
570
- if ((cmf & 0x0f ) == 0x08 ) {
571
- file = new FlateStream (fontFile );
572
- } else {
573
- file = fontFile ;
574
- }
563
+ file = new Stream (file , 0 , file .length , fontFileDict );
575
564
}
576
565
577
566
// For now, resolve the font object here direclty. The real font
Original file line number Diff line number Diff line change @@ -155,6 +155,11 @@ var PartialEvaluator = (function partialEvaluator() {
155
155
font .loadedName = loadedName ;
156
156
157
157
var translated = font .translated ;
158
+ // Convert the file to an ArrayBuffer which will be turned back into
159
+ // a Stream in the main thread.
160
+ if (translated .file )
161
+ translated .file = translated .file .getBytes ();
162
+
158
163
handler .send ('obj' , [
159
164
loadedName ,
160
165
'Font' ,
You can’t perform that action at this time.
0 commit comments