管道基础大数据平台系统开发-【CS】-ExportMap
13693261870
2024-09-07 8d7a67ab1d635cb954337d8a767878ae526dd3dc
ExportMap/Sources/MoonExp.py
@@ -144,8 +144,8 @@
size = map.sizeWithUnits()
print('size: ' + str(size.width()) + " * " + str(size.height()) + " mm")
if size.width() > 280 or size.height() > 174:
    map.attemptResize(QgsLayoutSize(280, 174, QgsUnitTypes.LayoutMillimeters))
if size.width() > 233 or size.height() > 174:
    map.attemptResize(QgsLayoutSize(233, 174, QgsUnitTypes.LayoutMillimeters))
    print('size: ' + str(map.sizeWithUnits().width()) + " * " + str(map.sizeWithUnits().height()) + " mm")
# 设置图层
@@ -158,12 +158,12 @@
# add_map_layer(project, layout)
# sm = layout.itemById(r'说明')
table = layout.multiFrames()[0]
'''table = layout.multiFrames()[0]
contents = table.tableContents()
# contents[0][1] = scale
contents[1][1].setContent(scale)
table.setTableContents(contents)
table.refresh()
table.refresh()'''
# collection = layout.pageCollection()
# page = collection.page(0)