Update dxf__omar3_2.py
Browse files- dxf__omar3_2.py +4 -8
dxf__omar3_2.py
CHANGED
|
@@ -446,12 +446,8 @@ def save_multiple_annotations_bax(annotations, output_path, column_order,pdfWidt
|
|
| 446 |
Resource = SubElement(GlobalResources, 'Resource')
|
| 447 |
SubElement(Resource, 'ID').text = scale
|
| 448 |
SubElement(Resource, 'Raw').text = '789c85d04f0b82401005f0af3247bd34a35176b085503c55847f22a80e2a4b7858ad7537e8dba7951ea2a5e330efc783e7fb983eae1c373c6fb5e498e842f577bcc6d872a014b00407848d87e310dd6a5170193552e40a33abfb0540139ace5ccff316188243844962d98c9d3134b297eba2f4255626d1dee06d3e200a4149cd47989ae0c99dd32fb8ebe0a8f7265dea3fb5b9bc7095d5950a9aface655b3575bf070d8b30f604438f6873'
|
| 449 |
-
|
| 450 |
-
|
| 451 |
-
# Bax: send as plain string (no base64, no prettyxml to avoid linebreaks)
|
| 452 |
-
# xml = tostring(doc, encoding="utf-8", method="xml").decode("utf-8")
|
| 453 |
-
# print(f" Saved {len(annotations)} annotations to {output_path}")
|
| 454 |
-
return pretty_xml
|
| 455 |
"""PDF to image"""
|
| 456 |
|
| 457 |
def pdftoimg(datadoc,pdf_content=0):
|
|
@@ -2528,7 +2524,7 @@ def mainFunctionDrawImgPdf(datadoc,dxfpath, dxfratio,SearchArray,pdfpath=0,pdfna
|
|
| 2528 |
# save_multiple_annotations_bax(
|
| 2529 |
# bax_annotations, 'Area_Perimeter_OMAR_output.bax', column_order, pdfWidth, pdfHeight
|
| 2530 |
# )
|
| 2531 |
-
|
| 2532 |
annotations, 'FF-Ceiling.bax', column_order, pdfWidth, pdfHeight
|
| 2533 |
)
|
| 2534 |
|
|
@@ -2589,7 +2585,7 @@ def mainFunctionDrawImgPdf(datadoc,dxfpath, dxfratio,SearchArray,pdfpath=0,pdfna
|
|
| 2589 |
list1.loc[len(list1)] =[annot.info['content'],annot.info['id'],annot.info['subject'],[x,y,z]]
|
| 2590 |
print('LISTTT',list1)
|
| 2591 |
# print(pretty_xml,column_xml)
|
| 2592 |
-
return doc2,image_new1, SimilarAreaDictionary ,spreadsheetId, spreadsheet_url , namepathArr , list1,hatched_areas,
|
| 2593 |
|
| 2594 |
# doc.save('Testing(2.7).pdf')
|
| 2595 |
# return doc,image_new1#, SimilarAreaDictionary ,spreadsheetId, spreadsheet_url , namepathArr , list1,hatched_areas
|
|
|
|
| 446 |
Resource = SubElement(GlobalResources, 'Resource')
|
| 447 |
SubElement(Resource, 'ID').text = scale
|
| 448 |
SubElement(Resource, 'Raw').text = '789c85d04f0b82401005f0af3247bd34a35176b085503c55847f22a80e2a4b7858ad7537e8dba7951ea2a5e330efc783e7fb983eae1c373c6fb5e498e842f577bcc6d872a014b00407848d87e310dd6a5170193552e40a33abfb0540139ace5ccff316188243844962d98c9d3134b297eba2f4255626d1dee06d3e200a4149cd47989ae0c99dd32fb8ebe0a8f7265dea3fb5b9bc7095d5950a9aface655b3575bf070d8b30f604438f6873'
|
| 449 |
+
bax_xml= tostring(doc, encoding="unicode", method="xml") #tostring(doc, encoding="utf-8", method="xml").decode("utf-8")
|
| 450 |
+
return bax_xml
|
|
|
|
|
|
|
|
|
|
|
|
|
| 451 |
"""PDF to image"""
|
| 452 |
|
| 453 |
def pdftoimg(datadoc,pdf_content=0):
|
|
|
|
| 2524 |
# save_multiple_annotations_bax(
|
| 2525 |
# bax_annotations, 'Area_Perimeter_OMAR_output.bax', column_order, pdfWidth, pdfHeight
|
| 2526 |
# )
|
| 2527 |
+
bax_xml=save_multiple_annotations_bax(
|
| 2528 |
annotations, 'FF-Ceiling.bax', column_order, pdfWidth, pdfHeight
|
| 2529 |
)
|
| 2530 |
|
|
|
|
| 2585 |
list1.loc[len(list1)] =[annot.info['content'],annot.info['id'],annot.info['subject'],[x,y,z]]
|
| 2586 |
print('LISTTT',list1)
|
| 2587 |
# print(pretty_xml,column_xml)
|
| 2588 |
+
return doc2,image_new1, SimilarAreaDictionary ,spreadsheetId, spreadsheet_url , namepathArr , list1,hatched_areas, bax_xml, column_xml
|
| 2589 |
|
| 2590 |
# doc.save('Testing(2.7).pdf')
|
| 2591 |
# return doc,image_new1#, SimilarAreaDictionary ,spreadsheetId, spreadsheet_url , namepathArr , list1,hatched_areas
|