문서를 내보내기 전에 발생합니다.
이벤트 객체를 통해 내보내기 API, Request Header, Parameter를 변경할 수 있습니다.
var editorId = 'synapEditor';
var editorConfig = {};
var html = '';
var editor = new SynapEditor(editorId, editorConfig, html);
editor.setEventListener('beforeExportFile', function (e) {
}); |
var editorId = 'synapEditor';
var editorConfig = {};
var html = '';
function SynapEditorBeforeExportFile(e) {
}
new SynapEditor(editorId, editorConfig, html); |
var editorId = 'synapEditor';
var editorConfig = {};
var html = '';
var eventListeners = {
beforeExportFile: function (e) {
}
};
new SynapEditor(editorId, editorConfig, html, eventListeners); |
함수로 전달되는 파라미터 e의 형식
// release 3.3.2603 이상
{
editor: SynapEditor,
eventType: 'beforeExportFile',
cancelable: false,
returnValue: null,
fileName: 'exportFileName', // defalut: 'untitled'
pageOrientation: 'portrait', // 'portrait'(defalut) | 'landscape',
exportFileFormat: 'hwpx' // 'docx' | 'hwpx'(defalut) | 'hwp'
} |
이벤트 객체를 통해 업로드 API를 설정할 수 있습니다.
{
beforeExportFile: function (e) {
e.setApi('newExportURL');
}
} |
이벤트 객체를 통해 Request Header를 설정할 수 있습니다.
{
beforeExportFile: function (e) {
e.addHeader('X-Hello', 'World');
}
} |
이벤트 객체를 통해 Parameter를 설정할 수 있습니다.
{
beforeExportFile: function (e) {
e.addParameter('hello', 'world');
}
} |