Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified __pycache__/__main__.cpython-38.pyc
Binary file not shown.
Binary file modified check_lattice/__pycache__/Lattice_2.cpython-38.pyc
Binary file not shown.
Binary file modified check_lattice/__pycache__/__init__.cpython-38.pyc
Binary file not shown.
Binary file modified check_lattice/__pycache__/check_line_scale.cpython-38.pyc
Binary file not shown.
Binary file modified check_lattice/__pycache__/make_border.cpython-38.pyc
Binary file not shown.
Binary file modified check_lattice/__pycache__/merge_table.cpython-38.pyc
Binary file not shown.
Binary file modified data_rendering/__pycache__/makeGoogleSheet.cpython-38.pyc
Binary file not shown.
Binary file modified utils/__pycache__/__init__.cpython-38.pyc
Binary file not shown.
Binary file modified utils/__pycache__/file_path.cpython-38.pyc
Binary file not shown.
Binary file modified utils/__pycache__/location.cpython-38.pyc
Binary file not shown.
Binary file modified utils/__pycache__/tasks.cpython-38.pyc
Binary file not shown.
Binary file modified www/__pycache__/__init__.cpython-38.pyc
Binary file not shown.
Binary file modified www/__pycache__/app.cpython-38.pyc
Binary file not shown.
Binary file modified www/__pycache__/views.cpython-38.pyc
Binary file not shown.
22 changes: 22 additions & 0 deletions www/static/css/menu_template.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
header {
position: relative;
width: auto;
height: 8%;
background: #F52C05;
}
header ul{
position: absolute;
height: 50%;
bottom: 10%;
}
header li{
list-style-type: none;
float: left;
height: 100%;
margin-left: 10px;
margin-right: 50px;
font-size: 32px;
font-weight: bold;
color: white;
cursor: pointer;
}
48 changes: 28 additions & 20 deletions www/static/css/extract.css → www/static/css/workspace.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,6 @@ body {
font-size : 12px;
height: 100vh;
}
header {
position: relative;
width: auto;
height: 8%;
background: #F52C05;
}
header ul{
position: absolute;
height: 50%;
bottom: 0;
}
header li{
list-style-type: none;
float: left;
height: 100%;
margin-left: 100px;
font-size: 28px;
color: white;
cursor: pointer;
}

#page_list_box{
position: absolute;
Expand All @@ -51,6 +31,16 @@ header li{
.thumb_img_select{
border: 2px solid #F52C05;
}
.check_page{
float:left;
width: 20px;
margin-left: 10px;
}
.exist_class{
float:right;
width: 16px;
margin-right: 10px;
}


#article_table{
Expand All @@ -67,6 +57,24 @@ input :not([type=radio]){
margin: 10px;
}

#top_tools{
width: 580px;
}
#top_tools input[type=button]{
font-size: 18px;
font-weight: bold;
}
.btn{
width: 160px;
}
.radio-inline input[type="radio"]{
width: 25px;
height: 25px;
margin-right: 10px;
margin-top: -1px;
vertical-align: middle;
}

#output {
margin: 0 20px;
padding: 20px;
Expand Down
Binary file added www/static/icon/check.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added www/static/icon/table.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion www/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@
</div>
</div>

<header></header>
{% include "menu_template.html" %}

<center>
<h1>PDF Table Extractor</h1>
Expand Down
10 changes: 10 additions & 0 deletions www/templates/menu_template.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

<link rel="stylesheet" type="text/css" href="{{url_for('static', filename='css/menu_template.css')}}">
<header>
<ul>
<li onclick='location.href="/"'>Upload</li>
<li>Workspace</li>
<li>Download</li>
<!-- <li style='font-size: 24px;'><b>{{fileName}}.pdf</b>&nbsp;&nbsp;&nbsp; p{{page}}</li> -->
</ul>
</header>
86 changes: 52 additions & 34 deletions www/templates/extract.html → www/templates/workspace.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
<title>PDF Table Select Areas</title>
<link rel="stylesheet" type="text/css" href="{{url_for('static', filename='css/extract.css')}}">
<link rel="stylesheet" type="text/css" href="{{url_for('static', filename='css/workspace.css')}}">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">

<!--[if lte IE 8]><link href="../resources/jquery.selectareas.ie8.css" media="screen" rel="stylesheet" type="text/css" /> <![endif]-->
Expand Down Expand Up @@ -381,7 +381,10 @@
var imageWidth = $('#pageImg').width();
var imageHeight = $('#pageImg').height();

$('.image-decorator div, .image-decorator img').css({'height':'70vh', 'width':(imageWidth/imageHeight*100)*0.7+'vh'});
var fit_width = (imageWidth/imageHeight*100)*0.7+'vh';

$('.image-decorator div, .image-decorator img').css({'height':'70vh', 'width':fit_width});
// $('#top_tools').css({'width':fit_height});

if( detected_areas.hasOwnProperty(String(this_page)) ){
page = String(this_page);
Expand Down Expand Up @@ -471,18 +474,23 @@

<body>
<div class="loader loader-default" data-text="Processing..."></div>
<header>
<ul>
<li onclick='location.href="/"'>HOME</li>
<li>BLAH BLAH</li>
<li>BLAH BLAH</li>
<!-- <li style='font-size: 24px;'><b>{{fileName}}.pdf</b>&nbsp;&nbsp;&nbsp; p{{page}}</li> -->
</ul>
</header>

{% include "menu_template.html" %}

<div id='page_list_box'>
{% for idx in range(1, totalPage+1) %}
<div class='thumb_page'>
<div class='thumb_page thumb_page_{{idx}}'>
<center>
{% set tables_len = detected_areas[idx]|length %}
<img src='/static/icon/check.png' class='check_page' style='display:none'>
<img src='/static/icon/table.png' class='exist_class' style='
{% if tables_len > 0 %}
display: inline;
{% else %}
display: none;
{% endif %}
'>
<br>
{% if idx == 1 %}
<img
class='thumb_img thumb_img_select'
Expand All @@ -493,6 +501,7 @@
id="thumb_page_{{idx}}">

{% else %}

<img
class='thumb_img'
src="{{url_for('static', filename='job_pdf')}}/{{fileName}}/page-{{idx}}-thumb.png"
Expand All @@ -503,7 +512,7 @@
{% endif %}
<br>
<span>{{idx}}</span>
<br><br>
<br>
</center>
</div>
{% endfor %}
Expand All @@ -513,17 +522,36 @@
<tr>
<td>
<div id="wrapper">

<input id='auto_detect' type='button' value='Auto Detected'>
<div style='float:right'>
<label title='Line Scale is the smallest length to detect PDF tables border lines'>
⯑ Line Scale&nbsp;<input style="width: 40px" type='text' id="line_scale" value="40">
</label>

<label>
<input type='button' id="get_line_size" value="get Line Size">
</label>
</div>
<table id="top_tools">
<tr>
<td></td>
<td>
<label title='Line Scale is the smallest length to detect PDF tables border lines'>
⯑ Line Scale&nbsp;<input style="width: 40px" type='text' id="line_scale" value="40">
</label>
</td>
<td>
<label class="radio-inline">
<input type="radio" name="optradio" value="areas">&nbsp;&nbsp;&nbsp;table_areas
</label>
</td>
</tr>
<tr>
<td>
<input id='auto_detect' type='button' class='btn btn-success' value='Auto Detected'>
</td>
<td>
<label>
<input type='button' id="get_line_size" class="btn btn-warning" value="Get Line Size">
</label>
</td>
<td>
<label class="radio-inline">
<input type="radio" name="optradio" value="regions" checked>&nbsp;&nbsp;&nbsp;table_regions
</label>
</td>
</tr>
</table>
<br>

<div class="image-decorator">
Expand All @@ -532,23 +560,13 @@

<center>
<span class="arrow">◀</span>
<input type="text">
<!-- <input type="text"> -->
<span class="arrow">▶</span>
</center>
</div>
</td>

<td style="width: 120px;">
<div style='position: absolute; top: 10%'>
<label class="radio-inline">
<input type="radio" name="optradio" value="areas">table_areas
</label>
<br>
<label class="radio-inline">
<input type="radio" name="optradio" value="regions" checked>table_regions
</label>
</div>

<input type="button" value="검출?" style="font-size: 18px; cursor:pointer;"/>
<br>
<input type="button" id="extract" value="추출▶" style="font-size: 18px; cursor:pointer;"/>
Expand Down
2 changes: 1 addition & 1 deletion www/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ def extract_page():
inputstream.close()

return render_template(
'extract.html',
'workspace.html',
fileName=fileName,
totalPage=total_page,
detected_areas=detected_areas[fileName],
Expand Down