Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Trouble with svg format
#1
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
It is more important to do the right thing, than to do the thing right.(P.Drucker)
Better is the enemy of good. (Montesquieu) = French version for 'kiss'.
Reply
#2
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
Reply
#3
@ Larz60+

This looks promising.
Will try and report on progress.

Paul
It is more important to do the right thing, than to do the thing right.(P.Drucker)
Better is the enemy of good. (Montesquieu) = French version for 'kiss'.
Reply
#4
23 minutes later.
I don't believe it; but it actually delivers the goods.

thanks,
Paul
It is more important to do the right thing, than to do the thing right.(P.Drucker)
Better is the enemy of good. (Montesquieu) = French version for 'kiss'.
Reply
#5
Glad to hear.
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020