File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -834,9 +834,6 @@ def output(
834834 if "csv" in fmt :
835835 # TODO: implement CSV output (preferably using CSV library)
836836 sys .stderr .write ("CSV output is not yet supported\n " )
837- if "pdf" in fmt :
838- # TODO: implement PDF output
839- sys .stderr .write ("PDF output is not yet supported\n " )
840837
841838 if filename is None :
842839 # stdout mode — emit each rendered format in the user-requested order
@@ -923,6 +920,9 @@ def _render(
923920 png_bytes = _embed_yaml_in_png (png_bytes , yaml_source )
924921 outputs ["png" ] = png_bytes
925922
923+ if "pdf" in fmt :
924+ outputs ["pdf" ] = graph .pipe (format = "pdf" )
925+
926926 if "gv" in fmt :
927927 outputs ["gv" ] = graph .source
928928
Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ def parse(
5454 * "gv": the diagram, as a GraphViz source file
5555 * "html": the diagram and (depending on the template) the BOM, as a HTML file
5656 * "png": the diagram, as a PNG raster image
57- * "pdf": the diagram and (depending on the template) the BOM, as a PDF file
57+ * "pdf": the diagram, as a PDF document (no BOM — see "html" for that)
5858 * "svg": the diagram, as a SVG vector image
5959 * "tsv": the BOM, as a tab-separated text file
6060
Original file line number Diff line number Diff line change 1919 "g" : "gv" ,
2020 "h" : "html" ,
2121 "p" : "png" ,
22- # "P": "pdf",
22+ "P" : "pdf" ,
2323 "s" : "svg" ,
2424 "t" : "tsv" ,
2525}
You can’t perform that action at this time.
0 commit comments