파일 (.doc)을 읽은 다음 doc에있는 일부 데이터를 바꾼 다음 print (doc 또는 pdf)로 보내야합니다.자바 스크립트 (각도)를 읽고 변경하고 저장하십시오.
처음 단계에서 나는 문서에서 데이터를 읽으려고합니다. 그 일이 .txt에서,하지만 .DOC에서 더 :(내가하려고 내가 jsfiddle http://jsfiddle.net/qo0fxo50/
예를했던
는 좋아하지 :<h1>Select file</h1>
<input type="file" on-read-file="showContent($fileContent)" />
<div>
<h2>File content is:</h2>
<pre>{{ contentfile }}</pre>
</div>
그리고 지시를 (에 읽기 파일) :
directives.directive('onReadFile', function ($parse) {
return {
restrict: 'A',
scope: false,
link: function(scope, element, attrs) {
var fn = $parse(attrs.onReadFile);
element.on('change', function(onChangeEvent) {
var reader = new FileReader();
reader.readAsText((onChangeEvent.target).files[0], 'CP1251');
reader.onload = function(onLoadEvent) {
scope.$apply(function() {
fn(scope, {$fileContent:onLoadEvent.target.result});
});
};
});
}
};
});
나는 jsfiddle http://jsfiddle.net/qo0fxo50/