Forum How do I...?

force a text to flow around a page?

adriencater
I have a complicated issue with page flow.

My book has a series full-page images, and normal text pages.

Normally, the image-page divs are between text section divs, so there's no problem with the document structure – BUT one of the text sections has a image page smack in the middle.

here's an ascii diagram (vertical bars are pages):

| image1 | textA | image2 | textB... | image3 | ... textB |

the 'image3' 'page' is right in the middle of the textB (which would normally just flow as two sequential text pages)

I can't "just" put the #image3 div in the middle of the #textB, since I don't want to break the text in the wrong place, it needs to flow to the next 'text' page naturally.

I can't move the page around by hand after the PDF is produced, as this would break page numbering.

I don't know how to approach this.

My only idea would be to put the image page div in side of the text, at some arbitrary location (might use jQuery to do this so as to keep the HTML source 'clean'), and then apply some esoteric rules with the :left and :right page selectors and perhaps the 'generated content' functionality?

Has anyone else already solved this (or not?)
mikeday
How about using "float: top next" for the image block, so that it will take the next page and not interfere with the text flow?
adriencater
Thanks for the suggestion, but that solution won't work in this case.

If PrinceXML gains any 'PDF manipulation' or 'page sequence control' functionality, I would suggest something along the lines of

@page foo { page-sequence: move(+2); }


to move a page 2 pages forward in the layout

@page foo { page-sequence: move(-3); }


to move a page 3 pages back in the layout

@page foo { page-sequence: move(19); }


to move a page to the position of page 19

all of this before the page counters are calculated, of course :)

other things falling into the same general category like re-sequencing pages for booklet printing might be useful, as well.

just an idea.