I have an XSLFO document with a couple of block elements that have page-break-inside="avoid". Also there is a title-Element before each block-element with keep-with-next.within-page="always".
So basically I have paragraphs with a title and title and paragraph should always be on the same page and there shouldn't be a page-break inside the paragraphs.
The problem is that there are some blocks that have too much content for one page. If the content only overflows the region-body but not the entire page, no page-break occurs, so the block is still on one page.
However, there are blocks where the text overflows the entire page and in that case, there is a page-break-before. One such block element with too much content should be on the first page of the document. However, there is a page-break and it is on the second page of the document.
So in essence, my problem is that there should be no page-breaks within the block-elements (the pargraphs), title and paragraph should always be on the same page AND there should be no page-break before the very first block-element, even if it overflows the entire page. The content should always start on the first page and there should be no empty pages at all.
Thanks for your help and suggestions!
The spec says:
Keep conditions are imposed by the "within-page", "within-column", and "within-line" components of the "keep-with-previous", "keep-with-next", and "keep-together" properties. The refined value of each component specifies the strength of the keep condition imposed, with higher numbers being stronger than lower numbers and the value always being stronger than all numeric values.
Have you tried different values? Maybe you could change page-break-inside="avoid" into keep-together="<your value here>" to use tuned values.
Edit: See spec http://www.w3.org/TR/2006/REC-xsl11-20061205/#keepbreak
Related
I am using XSLT and XSL-FO for document creation.
I need to introduce multiple sequences of page numbering, i.e main section numbered from 1 to end page, which is broken by two subsequences of corresponding subdocuments, numbered from 1 to end of each of these sections, and after them the main sequence is continued.
The problem I can't overcome is that the subsequences are counted in main sequence, and page number of main section after continuation is incremented page number of previous subsequence.
So I get e.g.
main section
subsection
subsection
continuation of main
1, 2, 3
1, 2
1, 2
3, 4, 5...
And I want
main section
subsection
subsection
continuation of main
1, 2, 3
1, 2
1, 2
4, 5, 6...
How can I achieve it?
In an FO file, the fo:page-sequence elements define a flat list of contents to be paginated, so there is no concept of a "main section" containing "subsections".
The initial-page-number property controls how page numbers are computed for a page sequence.
In particular, when a page sequence ends and a new one starts the only available options concerning page numbering are:
continue the enumeration with the next page number (optionally, the next odd one or even one)
restart from a specified number
There is no way to refer to a different page sequence and say "continue from that".
That said, if your document is not much more complicated than your example you can achieve what you want with a workaround.
This is probably the easiest (and dirtiest) one:
create the pdf output without changing anything; note down the page number that the "continuation of main" section should start from (4, in your example)
modifiy the FO file (or the XSLT), inserting initial-page-number="4" in the appropriate fo:page-sequence
recreate the output file
Slightly more complicated:
modify your XSLT so that it produces the fo:page-sequence elements in the order: (main section) - (continuation of main) - (subsection) - (subsection)
there is no need to specify initial-page-number for the "continuation of main" section; for subsections, use initial-page-number="1" to restart the page numbers (but they are already like this, from your example)
once you have the pdf, use some tool to move the pages around and have them in the order you desire
A cleaner and fully-automated solution would require using FOP's intermediate format:
create the intermediate format output
modify it to fix the page numbers as needed
create the final output from the modified intermediate file
A final note: you did not specify why your document needs such a peculiar page numbering and what degree of control you have on this requirement, but I cannot help wondering whether it is confusing for a reader to see page numbers restart that way, and difficult for them to find what they need ("I am told the information I need is on page 2; but which page 2?").
While using negative values for padding top in xsl fo-block, the block padding is adjusted but there is a space created on the bottom of the page. Even there is space in first page, some content goes to next page. Please help to resolve this issue
I want to answer this question:
Does the average time on page A (or more accurately page group A) affect the conversion rate of goal B?
So far in the GUI I have:
A) Created an advanced segment of Time on Page >= 120 ("per hit" option):
http://grab.by/tKOA
B) Modified the segment to also add a filter for Page = regex matching my group:
http://grab.by/tKOU
...But I don't know if this gives me the results I'm after; that is, if they are accurate
I have some other ideas, including assigning the page group as a funnel step and then segmenting by the Time on Page; still waiting on data to come in for that one
Wanting to know if there was a better solution or if I'm on the right track
Drewdavid,
Your approach is quite smart and correct, I would say, however keep in mind that in this context, you are mixing different scopes:
Time on Page is page-level metric
Page seen is visit-level dimension
What you would get in your report is the average time on page calculated from all the pages there were seen during visits which met the regex condition set in the filter (that's what segment does, it included all the pages, not just those that you want to filter). I know this can be confusing, but see this article that gives more examples and goes into greater detail.
To achieve what you are after, remove the segment filter and simply use the advanced filtering above the report table (and choose exactly the same regex you mentioned in your question).
Hope this helps!
My requirement is to produce, essentially, a page WITHIN a page. The xsl defines a page 1/3 the size of an A4 sheet, but up to 3 of them must print on the sheet. The page is a standard header/body/footer, with a 'Page X of Y' on it and of course it is simple. But if there are 4 of these "pages", only 2 pages should be printed, 3 on the first and 1 on the second. But 4 pages are printed, because the output PDF "tells" the printer that is a complete sheet. So what I want to do is either:
code the fo so it does not page break after it finished a page (something like page-break-after="avoid" but at the page sequence level)
OR
generate a page sequence within a page sequence, the outer one being defined as A4 size, the inner 1/3 of that.
I've tried the 2nd directly in a simple way, i.e.,
<fo:page-sequence master-reference="A4">
<fo:page-sequence master-reference="one-third_A4">
...
</fo:page-sequence>
</fo:page-sequence>
..and the processor definitely does NOT like it.
Are there any instructions I can apply that could do either of these? I looked in places like schemacentral and w3schools.com and cannot find anything.
Not sure if I understood you needs (a drawing would help), but can't you simply put your content into a series of fo:block-container elements with specified height? They would come out stacked vertically.
If you need more complex geometry, check out flow-maps feature of XSL 1.1. Three body regions per page connected sequentially in a <fo:flow-target-list>, and a single fo:flow providing content for them.
Having fo:page-sequence within another fo:page-sequence is not valid according to the spec (what would a page number mean then?), and every fo:page-sequence starts a new physical page by definition.
fo:page-sequence-wrapper won't help you on sub-page level either.
After a lot of hard work, I have created two yahoo Pipes I will be using.
One of them has a minor problem however... I am trimming the title length down to leave enough room for a ... and a link to fit within a tweet.
It trims the first post correctly... however it trims all of the posts after that to 0 length (before adding a bit of extra text to the end).
The problem is I'm not using a loop for all items after a certain point, but the reason for that is the output is always items from a loop, and I need the output to be number at a certain point so that I can feed in that number asa variable to trim the length by. The pipe can be found here: http://pipes.yahoo.com/pipes/pipe.info?_id=3e6c3c6b2d23d8ce0cf66cb3efc5fb56
Typically, I am inserting any RSS feed in the top box, something like "new blog post:" in the middle and "#bussiness #hashtags" in the last box.
If you can see any way I can have this yahoo pipe work for all posts rather than just the top one, please let me know. its not a big deal as im only ever posting for the moment, the top post to twitter... however there may come a point where I need all of them looking the same.