Python Forum

Full Version: Trouble with svg format
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

I am using python-barcode to create barcodes.
It produces .svg images and it works great, very crisp images.
I insert these barcodes manually into a word document = time consuming.

So I set out to produce the complete document using python.
But I tried creating a pdf, and then creating a word document, but both
refuse the svg format. (although word will accept a manual "insert picture" that is svg)

You can trick the issue by converting the svg into a png programatically,
but the penalty is unacceptable loss of quality.

So my question, how can I create a "printable document" using python, that will accept svg files,
and some very limited text ? (no code required, just how to)

thx,Paul
Paul Wrote:But I tried creating a pdf
What are you using to create PDF?

If using ReportLab, you can from reportlab.platypus import Flowable

and then code something like: https://stackoverflow.com/a/41806240
@ Larz60+

This looks promising.
Will try and report on progress.

Paul
23 minutes later.
I don't believe it; but it actually delivers the goods.

thanks,
Paul
Glad to hear.