简体   繁体   English

如何在 Python 中放大 SVG 文件?

[英]How to enlarge SVG files in Python?

I want to merge several SVG files into one.我想将多个 SVG 文件合并为一个。 For this I use the Python library Svgutils.为此,我使用 Python 库 Svgutils。 I do this using the following code.我使用以下代码执行此操作。

fig = Figure("75cm", "75cm", 
  SVG("_4_KuKaLinienRotate.svg").move(00,-50)
  ,SVG("_4_KuKaLinienRotate.svg").move(00,-100)
  ,SVG("_4_KuKaLinienRotate.svg").move(00,-150)
  ,SVG("_4_KuKaLinienRotate.svg").move(00,-200)).tile(1,4)
fig.save("_5_KuKaLinienRotateDup.svg")

Then I save the file as a PDF.然后我将文件另存为 PDF。

Output_PDF("_5_KuKaLinienRotateDup.svg","__3_Output_Rotate_Dup_PDF")

If I want to print this now, the pictures are all very small.如果我现在想打印这个,图片都很小。 Now my question is, how can you enlarge the SVG files so that they are no longer so small?现在我的问题是,如何放大 SVG 文件,使它们不再那么小?

In general how can you use python to enlarge and save an svg file?一般来说,您如何使用 python 来放大和保存 svg 文件?

I am not sure which library you are using here, might be on top of PyX.我不确定您在这里使用的是哪个库,可能在 PyX 之上。 (There is no SVG().move() etc. in PyX directly. But don't mind.) (直接在 PyX 中没有 SVG().move() 等。但不要介意。)

In PyX you could either scale the output by a transformation when inserting in a canvas, or you could adjust the resolution (defaults to 96 pt/inch) when loading the SVG file.在 PyX 中,您可以在插入画布时通过转换缩放输出,也可以在加载 SVG 文件时调整分辨率(默认为 96 pt/inch)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM