|
|
|
@ -5,20 +5,19 @@ from . import formfill
@@ -5,20 +5,19 @@ from . import formfill
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def ruler_overlay(original_form): |
|
|
|
|
|
|
|
|
|
def ruler(c, item): |
|
|
|
|
c.setStrokeColorRGB(0, 0, 1) |
|
|
|
|
c.setFillColorRGB(0, 0, 1) |
|
|
|
|
c.setLineWidth(0.5) |
|
|
|
|
c.setFont("Helvetica", 8) |
|
|
|
|
x_grid = [x*mm for x in range(10, 210, 10)] |
|
|
|
|
y_grid = [y*mm for y in range(10, 297, 10)] |
|
|
|
|
x_grid = [x * mm for x in range(10, 210, 10)] |
|
|
|
|
y_grid = [y * mm for y in range(10, 297, 10)] |
|
|
|
|
c.grid(x_grid, y_grid) |
|
|
|
|
|
|
|
|
|
for x in range(10, 210, 10): |
|
|
|
|
c.drawString((x-2)*mm, 5*mm, str(x)) |
|
|
|
|
c.drawString((x - 2) * mm, 5 * mm, str(x)) |
|
|
|
|
for y in range(10, 297, 10): |
|
|
|
|
c.drawString(4*mm, (y-0.5)*mm, str(y)) |
|
|
|
|
c.drawString(4 * mm, (y - 0.5) * mm, str(y)) |
|
|
|
|
|
|
|
|
|
ofp = Path(original_form) |
|
|
|
|
out_path = ofp.parent / f"{ofp.stem}_ruler.pdf" |
|
|
|
|