Spaces:
Sleeping
Sleeping
Update Counting_Columns_2_1.py
Browse files- Counting_Columns_2_1.py +3 -3
Counting_Columns_2_1.py
CHANGED
|
@@ -171,14 +171,14 @@ def generate_legend(found_tuple):
|
|
| 171 |
def add_annotations_to_pdf(image, pdf_name, slctd_clm, columns_types_v):
|
| 172 |
image_width = image.shape[1]
|
| 173 |
image_height = image.shape[0]
|
|
|
|
|
|
|
|
|
|
| 174 |
rotationOld=page.rotation
|
| 175 |
derotationMatrix=page.derotation_matrix
|
| 176 |
if page.rotation!=0:
|
| 177 |
rotationangle = page.rotation
|
| 178 |
page.set_rotation(0)
|
| 179 |
-
# Create a new PDF document
|
| 180 |
-
pdf_document = fitz.open('pdf',pdf_name)
|
| 181 |
-
page=pdf_document[0]
|
| 182 |
for i in range(len(slctd_clm)):
|
| 183 |
x, y = slctd_clm[i]
|
| 184 |
p_midpoint = fitz.Point(x, y) * derotationMatrix
|
|
|
|
| 171 |
def add_annotations_to_pdf(image, pdf_name, slctd_clm, columns_types_v):
|
| 172 |
image_width = image.shape[1]
|
| 173 |
image_height = image.shape[0]
|
| 174 |
+
# Create a new PDF document
|
| 175 |
+
pdf_document = fitz.open('pdf',pdf_name)
|
| 176 |
+
page=pdf_document[0]
|
| 177 |
rotationOld=page.rotation
|
| 178 |
derotationMatrix=page.derotation_matrix
|
| 179 |
if page.rotation!=0:
|
| 180 |
rotationangle = page.rotation
|
| 181 |
page.set_rotation(0)
|
|
|
|
|
|
|
|
|
|
| 182 |
for i in range(len(slctd_clm)):
|
| 183 |
x, y = slctd_clm[i]
|
| 184 |
p_midpoint = fitz.Point(x, y) * derotationMatrix
|