Skip to content

Impossible to target a chosen page on a multipage Inkscape document #140

Answered by spakin
duangdoock asked this question in Q&A
Discussion options

You must be logged in to vote

Yes. You can acquire the bounding box for each page then add each bounding box's left coordinate to x and top coordinate to y:

bboxes = [pg.bounding_box() for pg in all_pages()]
image('Image1.png', (bboxes[0].left + 200, bboxes[0].top + 200))
image('Image2.png', (bboxes[0].left + 400, bboxes[0].top + 400))
image('Image3.png', (bboxes[1].left + 200, bboxes[1].top + 200))
image('Image4.png', (bboxes[1].left + 400, bboxes[1].top + 400))

Alternatively, you might want to use an inkex.transforms.ImmutableVector2d to make the code easier to read:

bboxes = [pg.bounding_box() for pg in all_pages()]
origins = [inkex.transforms.ImmutableVector2d(bb.left, bb.top) for bb in bboxes]
image('Image1.png', o…

Replies: 1 comment 11 replies

Comment options

You must be logged in to vote
11 replies
@duangdoock
Comment options

@spakin
Comment options

Answer selected by duangdoock
@duangdoock
Comment options

@duangdoock
Comment options

@spakin
Comment options

@duangdoock
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #139 on November 02, 2024 04:57.