Last active
February 1, 2019 15:32
-
-
Save viniciusmelocodes/826d78090f5638b6962f8ccbcc9cba95 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>Conversão PDF para TXT</title> | |
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/css/bootstrap.min.css" integrity="sha384-GJzZqFGwb1QTTN6wy59ffF1BuGJpLSa9DkKMp0DgiMDm4iYMj70gZWKYbI706tWS" crossorigin="anonymous"> | |
</head> | |
<body> | |
<form action="#" method="post" enctype="multipart/form-data" name="conversionform" id="conversionform"> | |
<br> | |
<div class="container"> | |
<p>Arquivo Local: <input id="file" name="file" type="file" /></p> | |
<p>Para formato... <input value="txt" id="targetformat" name="targetformat" type="text" readonly /></p> | |
<p><input type="button" value="Converter PDF para TXT" onclick="convertpdfform()" /></p> | |
<!-- <p><span id="resulttext">Resultado da Conversão: </span></p> --> | |
<label>URL para Download: </label> | |
<a href="#" id="url_txt" target="_blank"> | |
<span id="mensagemElement"></span> | |
</a> | |
</div> | |
</form> | |
<script src="https://www.aconvert.com/js/jquery.min.js"></script> | |
<script src="https://www.aconvert.com/js/jquery.form.js"></script> | |
<script type="text/javascript"> | |
$(document).ready(function() { | |
}); | |
function showResponse(responseText, statusText, xhr, $form) { | |
// resulttext.innerHTML=responseText; | |
var inicio = responseText.search("http"); | |
var fim = responseText.search(".txt"); | |
var url_download = responseText.substring(inicio, fim + 4); | |
mensagemElement.innerText = url_download; | |
var url_txt = document.getElementById('url_txt'); | |
url_txt.setAttribute('href', url_download); | |
} | |
function showError(responseText, statusText, xhr, $form) { | |
} | |
function convertpdfform() { | |
options = { | |
success: showResponse, | |
error: showError, | |
url: "https://s2.aconvert.com/convert/api-win.php", | |
}; | |
$('#conversionform').ajaxForm(options); | |
$('#conversionform').ajaxSubmit(options); | |
return false; | |
} | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment