I'm trying to make a packing list which page break...
# advancedpdf
b
I'm trying to make a packing list which page breaks on each package (as opposed to a master packing list). I've figured enough out that I think I want to use a
<pbr/>
tag with
<pbr pagenumber="1"/>
to reset the page number, but it doesn't reset the totalpages page number. So if I have two packages, I get two pages, but both say "1 of 2". Is there a way to reset the total pages. To ask differently... what is the best way to effectively have multiple documents in the same PDF? Ideally if there are boxes, I'd have two packing slips, specific to the box relatively. If the first packing slip was two pages, and the second was one page, I'd have three pages, which were "1 of 2", "2 of 2", and "1 of 1" respectively. Thanks!
c
You don't have control over paging unless you know its gonna fit on a single page. Knowing this and using a custom PDF, you can control the pages using pbr and NOT using the default header and displaying the page as if it were a single page each pbr (each page would be 1 of 1 for example if you wanted)
Make a macro that takes in the data, start page and end page (both 1) and the first thing it does is display your "header" which would be custom now and then you can do your regular logic after that for displaying the rest.
b
Thanks for the tips. It seems a bit odd to me that you can reset the page counter with
<pbr pagenumber="1"/>
but can't reset the total pages the same way. Like that feature in BFO is half-baked
s
if you are okay not displaying the total #, you could leave it out, so you'd have two pages labelled 1 or page 1, without the " of 2"
b
Yea, I'm going to resort to that...
c
Yeah it would be nice to have more page control. It is the worst part of the BFO engine.
m
Might be a little bit of an overkill but you could try using pdfset and put each package in a separate "pdf" to reset the page numbers.
b
@michoel interesting. I'll investigate that approach.