Marthee commited on
Commit
25f7967
·
verified ·
1 Parent(s): c87ddad

Update deploying_3_3.py

Browse files
Files changed (1) hide show
  1. deploying_3_3.py +4 -8
deploying_3_3.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
- pretty_xml = parseString(tostring(doc)).toprettyxml(indent=" ")
450
- with open(output_path, 'w', encoding='utf-8') as f:
451
- f.write(pretty_xml)
452
-
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):
@@ -2497,7 +2493,7 @@ def mainFunctionDrawImgPdf(datadoc,dxfpath, dxfratio,SearchArray,pdfpath=0,pdfna
2497
  # save_multiple_annotations_bax(
2498
  # bax_annotations, 'Area_Perimeter_OMAR_output.bax', column_order, pdfWidth, pdfHeight
2499
  # )
2500
- pretty_xml=save_multiple_annotations_bax(
2501
  annotations, 'FF-Ceiling.bax', column_order, pdfWidth, pdfHeight
2502
  )
2503
 
@@ -2557,7 +2553,7 @@ def mainFunctionDrawImgPdf(datadoc,dxfpath, dxfratio,SearchArray,pdfpath=0,pdfna
2557
  x,y,z=int(annot_color.get(v)[0]*255),int(annot_color.get(v)[1]*255),int(annot_color.get(v)[2]*255)
2558
  list1.loc[len(list1)] =[annot.info['content'],annot.info['id'],annot.info['subject'],[x,y,z]]
2559
  print('LISTTT',list1)
2560
- return doc2,image_new1, SimilarAreaDictionary ,spreadsheetId, spreadsheet_url , namepathArr , list1,hatched_areas, pretty_xml, column_xml
2561
 
2562
  # doc.save('Testing(2.7).pdf')
2563
  # 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):
 
2493
  # save_multiple_annotations_bax(
2494
  # bax_annotations, 'Area_Perimeter_OMAR_output.bax', column_order, pdfWidth, pdfHeight
2495
  # )
2496
+ bax_xml=save_multiple_annotations_bax(
2497
  annotations, 'FF-Ceiling.bax', column_order, pdfWidth, pdfHeight
2498
  )
2499
 
 
2553
  x,y,z=int(annot_color.get(v)[0]*255),int(annot_color.get(v)[1]*255),int(annot_color.get(v)[2]*255)
2554
  list1.loc[len(list1)] =[annot.info['content'],annot.info['id'],annot.info['subject'],[x,y,z]]
2555
  print('LISTTT',list1)
2556
+ return doc2,image_new1, SimilarAreaDictionary ,spreadsheetId, spreadsheet_url , namepathArr , list1,hatched_areas, bax_xml, column_xml
2557
 
2558
  # doc.save('Testing(2.7).pdf')
2559
  # return doc,image_new1#, SimilarAreaDictionary ,spreadsheetId, spreadsheet_url , namepathArr , list1,hatched_areas