gramps-project / gramps-web

Open Source Online Genealogy System
https://www.grampsweb.org
GNU Affero General Public License v3.0
460 stars 60 forks source link

Export Family Tree Chart/Graph as Image #346

Open Wdavery opened 10 months ago

Wdavery commented 10 months ago

Within the Family Tree view, it would be handy to be able to export as an image.

Obviously the workaround is simply to screenshot the view, but in a large graph the resolution would end up quite low. Ideally you could export the entire graph as a PNG (with resolution dependent on the size of the graph).

geostag commented 10 months ago

Wouldn't it be better to get a PDF with scalable vector graphic containing the graph instead of a PNG file?

DavidMStraub commented 10 months ago

Indeed; it is already SVG but what will be tricky is including CSS and images.

@Wdavery just to check, you're aware of the graph reports, which can achieve similar things, albeit with slightly different style?

Wdavery commented 10 months ago

I am yes, they are certainly a functional replacement but are nowhere near as slick as the web view.

geostag commented 8 months ago

I will investigate on how to generate pdf out of the svg.

geostag commented 3 months ago

I tried svg2pdf but did not manage to get it working with gramps-web. Second try is using d3-save-svg. Using this, a svg file can be exported from any gramps-web chart: grafik

However there are some caveats: font is not embedded, images as well. I created a branch with relationship chart directly exporting svg. Not shure how to proceed.