New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Print multiple recordsheets to the same file as multiple pages? #91
Comments
You're right, and I noticed this while working on warships. I've got an uncommitted fix for it, but I haven't had time to update all of the printing classes yet. |
What needs to be done? I could take a swipe at it and submit a PR. |
Here's the diff. You won't have the What you need to pay attention to are: And here's some example code with pagination: https://docs.oracle.com/javase/tutorial/2d/printing/examples/PaginationExample.java I think this fix is basically done, except propagating it to all of the other classes. I wanted to finish the Warship printing changes, then make this fix as a separate branch, but I haven't gotten back to warship printing yet. |
OK, let me have a go at this. Thanks! |
OK, I've looked at the code a bit, and I'm wondering...will this approach fix the underlying problem, if the MUL (for example) to be printed contains different types of units? (e.g. Tanks, Mechs, BattleArmor)? If I read it correctly, the print job size will be the number of units of that type to be printed, as the master list is compiled in UnitPrintManager.java. Would it help to set the unknown number of pages constant? I'm still a little shaky about the semantics of print jobs and the master print job. |
I'd have to go back and review the documentation, but I think you're right. I didn't consider this because I only ever wrote the code to handle one unit type, but if you've got multiple unit types, there needs to be some mechanism to know the total number of units to print, and also where they are in the process. Additionally, it would probably be good to allow units to potentially have multiple pages (there's at least one official Warships RS that has two pages....). None of that seems particularly complicated to add, you just need the methods to compute that information (potentially a static |
I forgot where I had seen this conversation. When I couldn't find it on Slack I just went ahead and implemented this, then just before committing I checked to see if there was an issue open, and here was the conversation I was looking for. I used the |
No sweat. I haven't had as much time IRL to work on this as I'd hoped. I'm excited to see this implemented! |
Implemented in 1b61a11 |
Occasionally I like to print PDFs of recordsheets, to validate how things will look before committing to paper. It seems that MML outputs a new job for every page, instead of generating the whole print job and outputting that to a file.
On Linux, printing to cups-pdf doesn't give you the option to save each output job to a new file, as the Microsoft Print to PDF option does on Windows. I was wondering what was happening to the rest of my company, since no matter how many units were in my MUL, there was only one character sheet.
Still, I would prefer a single file with a bunch of character sheets, as I can be selective about which units I print from PDF inside a PDF viewer.
The text was updated successfully, but these errors were encountered: