]> git.parisson.com Git - pdf.js.git/commitdiff
added ability to write data to file
authorsbarman <sbarman@L3CWZ5T.(none)>
Thu, 21 Jul 2011 18:51:39 +0000 (11:51 -0700)
committersbarman <sbarman@L3CWZ5T.(none)>
Thu, 18 Aug 2011 20:53:25 +0000 (13:53 -0700)
fonts.js
utils/fonts_utils.js

index 356d7f9488758058d16e48064b280732fa039154..7dfa6ead7f509b95f3a6f20d227eca6157eda8a1 100755 (executable)
--- a/fonts.js
+++ b/fonts.js
@@ -446,6 +446,14 @@ var Font = (function Font() {
         break;
     }
 
+    var fileArr = [];
+    file.reset();
+    for (var i = 0, ii = file.length; i < ii; ++i)
+      fileArr.push(file[i]);
+
+    writeToFile(data, '/tmp/' + name + '_orig');
+    writeToFile(fileArr, '/tmp/' + name + '_new');
+
     this.data = data;
     this.type = properties.type;
     this.textMatrix = properties.textMatrix;
index edfc221863187ec17ca91dfbc04f40dee3ddb3b9..98ea607577c5f890d856601ad111b336f018b5bb 100644 (file)
@@ -1,8 +1,6 @@
 /* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- /
 /* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */
 
-'use strict';
-
 /**
  * The Type2 reader code below is only used for debugging purpose since Type2
  * is only a CharString format and is never used directly as a Font file.
@@ -391,7 +389,7 @@ function writeToFile(aBytes, aFilePath) {
 
   var stream = Cc['@mozilla.org/network/file-output-stream;1']
                  .createInstance(Ci.nsIFileOutputStream);
-  stream.init(file, 0x04 | 0x08 | 0x20, 0x180, 0);
+  stream.init(file, 0x04 | 0x08 | 0x20, 0666, 0);
 
   var bos = Cc['@mozilla.org/binaryoutputstream;1']
               .createInstance(Ci.nsIBinaryOutputStream);