Spaces:
Runtime error
Runtime error
<!-- app/templates/index.html --> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>PDF Language Issue Analyzer</title> | |
<style> | |
body { | |
font-family: Arial, sans-serif; | |
margin: 40px; | |
} | |
.container { | |
max-width: 800px; | |
margin: auto; | |
} | |
.upload-section { | |
border: 2px dashed #ccc; | |
padding: 20px; | |
text-align: center; | |
} | |
.upload-section:hover { | |
border-color: #333; | |
} | |
.results { | |
margin-top: 20px; | |
} | |
.issues { | |
margin-top: 10px; | |
} | |
.pdf-viewer { | |
margin-top: 20px; | |
} | |
</style> | |
</head> | |
<body> | |
<div class="container"> | |
<h1>PDF Language Issue Analyzer</h1> | |
<div class="upload-section"> | |
<form id="upload-form" enctype="multipart/form-data" method="post" action="/analyze"> | |
<input type="file" name="file" accept="application/pdf" required> | |
<br><br> | |
<button type="submit">Analyze PDF</button> | |
</form> | |
</div> | |
{% if language_issues %} | |
<div class="results"> | |
<h2>Language Issues Found: {{ language_issues.total_issues }}</h2> | |
<div class="issues"> | |
<ul> | |
{% for issue in language_issues.issues %} | |
<li> | |
<strong>Message:</strong> {{ issue.message }}<br> | |
<strong>Context:</strong> {{ issue.context }}<br> | |
<strong>Suggestions:</strong> | |
{% if issue.suggestions %} | |
{{ issue.suggestions | join(", ") }} | |
{% else %} | |
None | |
{% endif %} | |
<hr> | |
</li> | |
{% endfor %} | |
</ul> | |
</div> | |
{% if annotated_pdf %} | |
<div class="pdf-viewer"> | |
<h3>Annotated PDF:</h3> | |
<embed src="{{ annotated_pdf }}" type="application/pdf" width="100%" height="600px" /> | |
<br> | |
<a href="{{ annotated_pdf }}" download="annotated_document.pdf">Download Annotated PDF</a> | |
</div> | |
{% endif %} | |
</div> | |
{% endif %} | |
</div> | |
</body> | |
</html> |