MCPcopy Create free account
hub / github.com/PageBot/PageBot / drawPageMetaInfo

Method drawPageMetaInfo

Lib/pagebot/elements/views/mapview.py:196–223  ·  view source on GitHub ↗

Draws the foreground meta info of the page, depending on the settings of the flags. >>> from pagebot import getContext >>> context = getContext() >>> from pagebot.document import Document >>> path = '_export/PageMetaInfo.pdf' >>> w, h = 300, 400

(self, page, origin, path=None, background=False)

Source from the content-addressed store, hash-verified

194 # D R A W I N G.
195
196 def drawPageMetaInfo(self, page, origin, path=None, background=False):
197 """Draws the foreground meta info of the page, depending on the settings
198 of the flags.
199
200 >>> from pagebot import getContext
201 >>> context = getContext()
202 >>> from pagebot.document import Document
203 >>> path = '_export/PageMetaInfo.pdf'
204 >>> w, h = 300, 400
205 >>> doc = Document(w=w, h=h, autoPages=1, padding=30, context=context)
206 >>> page = doc[1]
207 >>> view = doc.getView()
208 >>> view.showGrid = [GRID_COL, GRID_ROW]
209 >>> view.drawPageMetaInfo(page, (0, 0), path)
210 """
211 if not background:
212 self.drawFrame(page, origin)
213 self.drawPadding(page, origin)
214 # Use path to show file name in page meta info.
215 self.drawNameInfo(page, origin, path)
216 # Color bars under registration marks?
217 self.drawColorBars(page, origin)
218 self.drawRegistrationMarks(page, origin)
219 self.drawCropMarks(page, origin)
220 self.drawElementOrigin(page, origin)
221 self.drawGrid(page, origin, background=background)
222 self.drawBaselines(page, origin, background=background)
223 self.drawFlowConnections(page, origin)
224
225 def drawFrame(self, e, origin):
226 """Draws the page frame if the the flag is on and if there is enough

Callers 8

buildMethod · 0.95
buildMethod · 0.45
buildMethod · 0.45
buildMethod · 0.45
buildMethod · 0.45
buildMethod · 0.45
buildMethod · 0.45
buildMethod · 0.45

Calls 10

drawFrameMethod · 0.95
drawPaddingMethod · 0.95
drawNameInfoMethod · 0.95
drawColorBarsMethod · 0.95
drawRegistrationMarksMethod · 0.95
drawCropMarksMethod · 0.95
drawElementOriginMethod · 0.95
drawGridMethod · 0.95
drawBaselinesMethod · 0.95
drawFlowConnectionsMethod · 0.95

Tested by

no test coverage detected