larrychristensen / orcpub

Code for OrcPub2.com
Eclipse Public License 2.0
129 stars 179 forks source link

Printing Picadilos #47

Open KeyMasterOfGozer opened 6 years ago

KeyMasterOfGozer commented 6 years ago

I love love love this tool. I want you to know that because I don't want you to feel my issues with the PDF are too negative. Also, this might be my mistake in inputting something. I know PDFs are always a challenge, though, but here are some observations.

Page 1: 1) There is a large section for "Features & Traits", but this is always empty taking up a lot of wasted real estate on the front page. The Features and Traits already get a full page to themselves (page 5). 2) The Equipment list is kind of all crammed together in a messing concatenated string in a very small box. Maybe it should be moved to where the Features and Traits are?

Page 2: For me, everything on this sheet is always blank except for the top box with the height and weight, etc. Most of this stuff I didn't fill in, but I do have treasures on my equipment tab, but they are not filled in here, they are instead concatenated with the other equipment.

Page 3 and 4: I'm not a fan of having a partial list of each spell level on each side of the sheet of paper. I think it would be better to have the whole Spell Level together and the higher levels on the second page instead, but I understand that you probably do it this way so that printing "Prepared Only" spells will use the same template as printing all spells, so I can live with that, but it would be super helpful to order the spells such that the Prepared ones come first in the list, then the rest of the Knowns, so that it can be used as a reference much more easily. That will put the more frequently used Prepareds on the front page. Would be nice to mark the Prepareds somehow as well.

As an aside, it might be easier to give some XML or other output for the character instead of a hard-coded PDF. You will never please everyone, but if we had an XML with all the things, then you could leverage the community to make lots of varied XSL transforms that will make all kinds of charsheets that work better for specific kinds of characters.

Many years ago there was a Character Builder program for the Shadowrun game called Chummer. It did this very thing, I was able to contribute XSLTs that let you pick and choose sections to print and made great use of page real estate as well as being completely dynamic. If you had a long Equipment list, it would take up a lot of space, else wise, the space could be used by a spell list if that was longer. Anyway, it is late and I am now rambling.

Thank you for the super cool Char Builder!

codeGlaze commented 6 years ago

@KeyMasterOfGozer By chance can you drop some links with example output and PDFs that work with the output? This is interesting.

KeyMasterOfGozer commented 6 years ago

I'm fuzzy on the details, since looking back at my files, I did this stuff in 2003. Time Flies, I guess.

I used to have a page on my website that would match the XMLs with an XSL transform that one liked, but that page isn't there anymore. At the time, you could just do this transform locally to test things, but apparently now, Chrome doesn't allow this since it is a security risk of some kind, so it's a little more complicated to test this out, but I did find a site that can run the transforms for you to test: http://www.utilities-online.info/xsltransformation/#.WwGGiYjwZaQ

So, for the Shadowrun 3 chars that we were working with at the time, here is an example of one file transformed: http://www.utilities-online.info/xsltransformation/?save=ac554ee4-f605-47e1-8db0-e3d0c7a0544f-xsltransformation

This should show the HTML: http://www.oldforest.net/srchars/Preacher.xml

So this uses "Preacher.xml" and transforms it with the transform "SR3-CharacterMG.xsl"

You can find that transform at: http://www.oldforest.net/srchars/SR3-CharacterMG.xsl

So the XSLTransform takes a given XML, and imposes it's Rules to generate an output XML, in this case HTML, so given a Character's output XML, a user could generate any number of XSL's to generate different kinds of formatted HTML outputs based on specifics of this particular character. The idea back then with Chummer, was to allow the community to create lots of different ways to display characters from the same output of the char generator. An end user could them choose his preference from dozens that people who could write XSLs made.

So in the case of this example http://www.oldforest.net/srchars/Preacher.xml

You can see the HTML generated has Red Bars in certain locations for you to be able to Show/Hide sections, and/or place a Page Break. The sections show up on the browser, but don't show up when you Print. That is done in the accompanying CSS: http://www.oldforest.net/srchars/style.css

@page {
    margin: 1.9cm;
    size: 21cm 27.9cm;
}

@media print {
    .zalomit {
        page-break-after: always;
    }
    .common {
        visibility: hidden;
        display:none;
    }

    .table {
        width: 17cm;
    }
}

Because of the @page and @media print parts, it lets the HTML format correctly to print. If you wanted a PDF, you could print to PDF from there, or just print from the browser.

From reference, here are some other char xmls (from this project): http://www.oldforest.net/srchars/GordonSchumway.xml http://www.oldforest.net/srchars/John%20Smith.xml http://www.oldforest.net/srchars/MageFace.xml http://www.oldforest.net/srchars/Stumpy.xml

And here are some other XSLs (from this project): http://www.oldforest.net/srchars/SR3-CharacterMK.xsl http://www.oldforest.net/srchars/SR3-CharacterMR.xsl http://www.oldforest.net/srchars/VehicleBlock.xsl

For what it's worth, I'm a good backend designer, but not a good frontend designer, so pages I develop tend to be very practical, but not pretty, but I think you can at least get the idea I'm trying to express.

Cheers!

KeyMasterOfGozer commented 6 years ago

I guess I discussed some of the technical things, but from a design standpoint, also to note is that there are blocks on the generated sheet for "Skills", "Spells", "Equipment", "Contacts", etc.

Each of these sections is dynamic. If you have a lot of Equipment, then the printout will have a larger section on the page for Equipment. If you don't have much Equipment, then the section is smaller and takes up less real estate on the printed page, giving more room for Skill or Spell or whatever. Each section dynamically adjusts to how much data is in each section, then the user will select the Page Breaks such that he gets a nicer page layout, or just hides section that are not important to this particular character build, such as hiding the Spells section if you are not a spell caster.

This let you get the maximum amount of info on the smallest number of pages. Wastes less page space.

One could imagine a more gifted HTML person could design this with DIVs that could be dragged and reordered as well, possibly allowing a user to get even better efficiency.

It's not perfect, of course, but since it is built from an XSLT, this gives other people a chance to tweak it for their own needs and share with the community.

KeyMasterOfGozer commented 6 years ago

To tell the truth, XML is a very 90s way of transferring data, anyway. JSON is much more common these days. With JSON, I (or any programmer) could potentially write a much easier python script to generate something rather than horse around with a much less forgiving XSLT, but using XML/XSLTs would making it easier to have templates for printing right on the Site without having to download and process with a script first to print. I don't know, there are a lot of options.

codeGlaze commented 6 years ago

XML is still a relatively common output. JSON to XML is a possibility, too.

Hm...