PDA

View Full Version : FG5eXmlToPdf Project



not_so_there
September 26th, 2017, 15:55
unstable / alpha Release: https://github.com/JDCain/FG5eXmlToPdf/releases/tag/0.6.1

- Patch for null error.

all releases: https://github.com/JDCain/FG5eXmlToPdf/releases/

Project: https://github.com/JDCain/FG5eXmlToPdf

Usage is from the command line and it takes a path to the XML file. Output is a pdf in the format of "Character Name (#TotalLevel#).pdf"
PDF should be editable still after being built.

Per suggestion moved long descriptions of feats, features, and traits to 4th page with large form field on it. I've kept it as a field so it will still be editable using the free version of Acrobat if necessary.

---
Know some C#/.Net and want to help out with a small project? I've created a simple proof of concept class library with a unit test which reads in a Fifth Edition FG Character XML and then writing the data to one of the official form fillable character sheets. I will keep flushing it out but with limited time I was looking to see if anyone else was interested in contributing in order get a working app faster.

It's using iTextSharp to read in and then stamp the matching pdf fields. All of the fields in the PDF have defined names so it would be a process of matching up items from the xml to the pdf fields and logic for how to convert or handle multiple items or large text for formatting into a pdf form.

My personal use cases for this are:
1) be able to give players sheets for premade characters before staring games.
2) provide sheets for when using FG as a table top.

https://github.com/JDCain/FG5eXmlToPdf

Current design idea is Xml -> Character model -> Pdf
That way the model could be reused for other outputs by others in the future if they want to.

kp9911
September 26th, 2017, 16:03
Nice hope this idea takes off!

not_so_there
September 27th, 2017, 13:48
Ability scores, bonus, saves, and save proficiency check boxes working.
I had to edit the form pdf as some of the fields had extra spaces at the ends. May end up being easier to just edit the pdf to give real names to the check boxes associating them with a item rather then just numbers.

Also skills now.

added more, see attachment.

JohnD
September 28th, 2017, 15:26
Nice. Props.

not_so_there
September 28th, 2017, 17:57
unstable / alpha Release: https://github.com/JDCain/FG5eXmlToPdf/releases/tag/0.1.0-ci.27
I updated the main post but I am assuming editing doesn't trigger updates to the thread so I am posting here.

First page is getting closer to being done. Usage is from the command line and it takes a path to the XML file. Output is a pdf in the format of "Character Name (#TotalLevel#).pdf"
PDF should be editable still after being built. So while note complete may still be useful for users to not have to copy and past every field.
For the fields with large amounts of text I assume right now that more text is going to just keep making the font smaller until it's unreadable. At some point I will need to set a max and drop some of the info on the next page(s).

For bugs please try and report them on githib as it will make it easier to track than this thread.

Thegroo
September 29th, 2017, 01:11
Awsome

not_so_there
September 29th, 2017, 16:19
Nice. Props.

Runs on props: https://www.youtube.com/watch?v=KWecfzkKiIM

not_so_there
October 2nd, 2017, 18:44
unstable / alpha Release: https://github.com/JDCain/FG5eXmlToPdf/releases/tag/0.2.0
Added placing first 3 weapons on the pdf form along with attack and damages. It works but with multiple damage types it gets cut off and is hard to read (see attachment image)

niknas
October 5th, 2017, 16:43
Finally a readable/modifiable character sheet solution for in person FG gaming! AL Online uses the AGL sheet as image instead of vectorized. The font size is like 9pt and unreadable for us old codgers. The same goes for the XSL solution built with Unity that just uses an image as background. For us cursed with the A4 paper format, we get misaligned stats all over the place.
So a biig thumbs up and keep it up!

not_so_there
October 6th, 2017, 18:41
0.3.0: https://github.com/JDCain/FG5eXmlToPdf/releases/tag/0.3.0

added: Equipment, proficiencies & languages, Features & Traits, Additional Features & Traits, 2nd page character name, Age, Height, Weight, and Faction.

Current output: 20904

Not sure how to handle massive amounts of text for Feats, Traits, & Features. At higher levels these would be impossible to read.

LordEntrails
October 7th, 2017, 02:32
Not sure how to handle massive amounts of text for Feats, Traits, & Features. At higher levels these would be impossible to read.
What about an option that text can go on a second/third page? i.e. check a box for Feats and the name of the feat goes on the main page but then all the feat text goes in what is effectively an appendix page. Same with Traits, Features, Spells, etc?

not_so_there
October 11th, 2017, 15:42
What about an option that text can go on a second/third page? i.e. check a box for Feats and the name of the feat goes on the main page but then all the feat text goes in what is effectively an appendix page. Same with Traits, Features, Spells, etc?

Great idea!

Release 0.4.0: https://github.com/JDCain/FG5eXmlToPdf/releases/tag/0.4.0
Per suggestion moved long descriptions of feats, features, and traits to 4th page with large form field on it. I've kept it as a field so it will still be editable using the free version of Acrobat if necessary.

not_so_there
October 12th, 2017, 19:41
unstable / alpha Release(s):
New: https://github.com/JDCain/FG5eXmlToPdf/releases/tag/0.5.0

added: spell list and prepared marks, fixes for crash on missing damage bonus, other fixes, see commits.

not_so_there
October 16th, 2017, 20:00
Fix: https://github.com/JDCain/FG5eXmlToPdf/releases/tag/0.5.2
Fixes https://github.com/JDCain/FG5eXmlToPdf/issues/9

ssides
October 17th, 2017, 12:39
This is really cool. I just tested it out, and there was just one thing that seems odd.

The character I tested it on has the Alert feat, which gives +5 to Init. But the initiative listed on the PDF character sheet is 508. He has 16 DEX +5 for Alert, so the number should be 8. Just figured you might need to know.

not_so_there
October 17th, 2017, 15:09
The character I tested it on has the Alert feat, which gives +5 to Init. But the initiative listed on the PDF character sheet is 508. He has 16 DEX +5 for Alert, so the number should be 8. Just figured you might need to know.

ty

Can you post an export of the char so I can look at the xml and run it though in debug?

For the time being if you open it in Reader DC you should be able to and change it manually since it's using editable form fields (Some other PDF form readers may work too but I don't know which).

not_so_there
November 17th, 2017, 17:35
unstable / alpha Release: https://github.com/JDCain/FG5eXmlToPdf/releases/tag/0.6.0
- Removed photo box from PDF and now add appearance text from XML.
- Filtered powers so that only items from the Spells group are added into the spells sheet.
- Added spell casting class and ability (uses first class in list if multi-classing)
- Added Spell Slots.

LordEntrails
November 17th, 2017, 18:38
Glad to see you are still working on this. It's on my plate to explore and do more with. But dang my plate is pretty full *G*

Thegroo
November 18th, 2017, 01:44
Glad to see you are still working on this. It's on my plate to explore and do more with. But dang my plate is pretty full *G*

Mine too, but looking forward to test it.
Thanks for the work

not_so_there
December 1st, 2017, 19:14
unstable / alpha Release: https://github.com/JDCain/FG5eXmlToPdf/releases/tag/0.6.1
- Patch for null error.

richg
June 14th, 2018, 23:28
Works great! Thanks :)

ddblue0
January 20th, 2019, 05:08
I really love this concept, but I am not so technically-minded. Forgive me, but can someone please lead me to some documentation where I can find the various arguments we can use? I wasn't able to find it on my own :/

niknas
January 24th, 2019, 14:33
There's not much to it. Download the app from the link in the first post (https://github.com/JDCain/FG5eXmlToPdf/releases/download/0.6.2/FG5eXmlToPdf_0.6.2_unstable.zip), extract it and run the app from a command window i.e FG5eXmlToPdf.exe faffner.xml where faffner.xml is an example character XML file of mine exported from Fantasy Grounds and put in the same directory as the app. The app will generate an editable PDF in the same directory.

Zacchaeus
January 24th, 2019, 14:46
There's not much to it. Download the app from the link in the first post (https://github.com/JDCain/FG5eXmlToPdf/releases/download/0.6.2/FG5eXmlToPdf_0.6.2_unstable.zip), extract it and run the app from a command window i.e FG5eXmlToPdf.exe faffner.xml where faffner.xml is an example character XML file of mine exported from Fantasy Grounds and put in the same directory as the app. The app will generate an editable PDF in the same directory.

I think the poster would like to know what a command line is.

niknas
January 25th, 2019, 13:11
In that case perhaps https://www.digitalcitizen.life/7-ways-launch-command-prompt-windows-7-windows-8? :)

nibowl
January 26th, 2019, 10:40
I really like this tool, however, with half of my xml files I get the following (using version 0.6.0 or 0.6.1, 0.6.2 has the same but a different path that seems to have been compiled in)


System.NullReferenceException: Object reference not set to an instance of an object.
at FG5eXmlToPDF.FG5eXml.GetSkills(List`1 skillList, ICharacter character) in C:\Source\repos\FG5eXmlToPdf\FG5eXmlToPdf\Fg5eXml. cs:line 205
at FG5eXmlToPDF.FG5eXml.LoadCharacter(String fileString) in C:\Source\repos\FG5eXmlToPdf\FG5eXmlToPdf\Fg5eXml. cs:line 21
at FG5eXmlToPdf.Console.Program.Main(String[] args)

Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object.
at FG5eXmlToPDF.FG5eXml.GetSkills(List`1 skillList, ICharacter character) in C:\Source\repos\FG5eXmlToPdf\FG5eXmlToPdf\Fg5eXml. cs:line 205
at FG5eXmlToPDF.FG5eXml.LoadCharacter(String fileString) in C:\Source\repos\FG5eXmlToPdf\FG5eXmlToPdf\Fg5eXml. cs:line 21
at FG5eXmlToPdf.Console.Program.Main(String[] args)

damned
January 26th, 2019, 11:32
Welcome nibowl
Do the half that fail have any similarities in filename? Eg spaces or special characters?

nibowl
January 26th, 2019, 12:19
They are all just single name .xml. Example:

Leonardo.xml
Donatello.xml
Michelangelo.xml
Raphael.xml

What Leo and Raph work but the other two fail for example.

Trenloe
January 26th, 2019, 15:39
I really like this tool, however, with half of my xml files I get the following (using version 0.6.0 or 0.6.1, 0.6.2 has the same but a different path that seems to have been compiled in)
The error is raised when processing the skill list. See if you can spot a difference in the skill list for the PCs that work and those that don’t. You may need to look at the exported PC XML if there’s not a clear difference looking at it in the FG GUI.

nibowl
January 27th, 2019, 15:38
It appears that somehow the characters xml files that work have all of the skills listed in them regardless of proficiency. The ones that fail only have the skills they are proficient in contained in the xml. I didn't create them in different manners though, which is odd.

duff563
February 10th, 2019, 19:44
In my tests of this exporter, it would crash when exporting a custom skill added to the PC sheet in FG..for example, I added a Stonecunning skill roll with explanation. Exporter would crash. Once I removed, export worked perfectly.

duff563
February 10th, 2019, 19:55
Addendum, I did not have a stat associated with another custom skill roll, ie...DEX... once I added the proper stat entry, the exporter worked perfectly. So custom skills checks DO export properly.

comicsmaverick
July 13th, 2020, 20:56
I've been looking for a way to export Fantasy Grounds Unity character sheets to printable PDFs, but I cannot get this program to work. Perhaps I am not running it correctly. I am running it from Command Prompt (admin privileges) with "start [file path]\FG5eXmlToPdf.exe," but I get an error message saying "This application could not be started." Do I need to do it differently, or is there a better way to export character sheets to PDFs?

Trenloe
July 13th, 2020, 21:00
Welcome to the FG forums!


I've been looking for a way to export Fantasy Grounds Unity character sheets to printable PDFs, but I cannot get this program to work. Perhaps I am not running it correctly. I am running it from Command Prompt (admin privileges) with "start [file path]\FG5eXmlToPdf.exe," but I get an error message saying "This application could not be started." Do I need to do it differently, or is there a better way to export character sheets to PDFs?
Just run the executable. So [file path]\FG5eXmlToPdf.exe [XML filename]

See the "usage from command line" info at the bottom of the release thread: https://github.com/JDCain/FG5eXmlToPdf/releases/

comicsmaverick
July 13th, 2020, 21:42
Thanks, I did have the character XML filename in there, but I was using an old version of the app. :P I got one character sheet out of two files I've tried. Is there a way to tell it where to create the PDF? I had to search my hard drive for it, and finally found it in a system folder. I ran the app from my desktop.

Trenloe
July 13th, 2020, 21:46
Thanks, I did have the character XML filename in there, but I was using an old version of the app. :P I got one character sheet out of two files I've tried. Is there a way to tell it where to create the PDF? I had to search my hard drive for it, and finally found it in a system folder. I ran the app from my desktop.
I don't know, I don't use it. Maybe try running it from somewhere other than your desktop - I don't know if that will make a difference.

Griogre
July 13th, 2020, 22:18
The app saves to the same directory it's run in. It makes me nervous when people run these type of app with admin inside a system directory. He says it's alpha and unstable. Create a folder inside Documents and run it there or in a directory just off of a non booting drive, ie d:\char

LOL you just reminded me I haven't done a back up in a while. I think I'll go do one...

comicsmaverick
July 14th, 2020, 01:06
The app saves to the same directory it's run in. It makes me nervous when people run these type of app with admin inside a system directory. He says it's alpha and unstable. Create a folder inside Documents and run it there or in a directory just off of a non booting drive, ie d:\char

LOL you just reminded me I haven't done a back up in a while. I think I'll go do one...

Yeah I just wanted to make sure it would actually work, and I had already tried running it in my synced Google Drive folder with no luck. I swear I did the exact same thing in Command Prompt multiple times, and one time it worked, but I haven't gotten it to work since. It was also really weird that it generated the PDF into a random system folder and not the one I actually ran it from. Not sure what I did wrong, but I'm giving up for now. Faster for me to transcribe by hand. :(