| | |
| | | |
| | | 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") |
| | | |
| | | # 设置图层 |
| | |
| | | # 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) |