gramps-project / gramps-web

Frontend for Gramps Web
https://www.grampsweb.org
GNU Affero General Public License v3.0
423 stars 58 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 9 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 9 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 9 months ago

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

geostag commented 7 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.