Extract Input Data
Use OZ Viewer API
OZViewer.GetInformation("INPUT_JSON_ALL")
export.html
<!DOCTYPE html>
<html style="height:100%">
<head>
<meta charset="UTF-8"/>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
<script src="https://code.jquery.com/jquery-2.0.3.min.js"></script>
<link rel="stylesheet" href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css" type="text/css"/>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.min.js"></script>
<link rel="stylesheet" href="/html5viewer/ui.dynatree.css" type="text/css"/>
<script type="text/javascript" src="/html5viewer/jquery.dynatree.js" charset="utf-8"></script>
<script type="text/javascript" src="/html5viewer/OZJSViewer.js" charset="utf-8"></script>
<script type="text/javascript" src="/html5viewer/pdf_js/web/compatibility.js"></script>
<script type="text/javascript" src="/html5viewer/pdf_js/build/pdf.js"></script>
</head>
<body>
<div style="text-align:center">
<form id="form">
<input type="hidden" id="ozrName" name="ozrName">
<input type="hidden" id="exportFormat" name="exportFormat">
<input type="hidden" id="inputData" name="inputData">
<span >e-Form Export Request To </span>
<input type="button" value="OZViewerExport" onclick="exportForm('OZViewerExport')" >
<input type="button" value="export" onclick="exportForm('export')" >
<input type="button" value="directExport" onclick="exportForm('directExport')" >
</form>
</div>
<div id="OZViewer" style="width: 98vw; height: 90vh;"> </div>
<script type="text/javascript" >
var exportFormat = "pdf";
var ozrName = "KYC_Form";
function exportForm(service) {
if (OZViewer.GetInformation("INPUT_CHECK_VALIDITY") == 'valid') {
var inputData = OZViewer.GetInformation("INPUT_JSON_ALL");
$('#ozrName').val(ozrName);
$('#exportFormat').val(exportFormat);
$('#inputData').val(inputData);
var data = $('form').serialize();
console.log(data);
$.ajax({
type : "POST",
url : service + ".jsp",
data : data,
async : false,
success : exportCallback,
error : function(request, status, error) {
if (request.status != '0') {
alert("code : " + request.status + "\r\nmessage : " + request.reponseText + "\r\nerror : " + error);
}
alert("Failed to export.");
}
});
}
}
var exportCallback = function(resp){
console.log(resp);
};
function SetOZParamters_OZViewer() {
var oz = document.getElementById("OZViewer");
oz.sendToActionScript("connection.servlet", "/oz/server");
oz.sendToActionScript("connection.reportname","/demo/KYC_Form.ozr");
return true;
}
start_ozjs("OZViewer", "/html5viewer/");
</script>
</body>
</html>
Last updated
Was this helpful?