Comments (6)
Hello!
Here’s the PDF I get
This result is much better than yours!
The image size is wrong, but I get the same rendering with my browsers, that’s not a problem with CairoSVG.
from cairosvg.
cool!, if i can ask, what was the command line you used?
from cairosvg.
The image size is wrong, but I get the same rendering with my browsers...
That's weird, just to be sure i downloaded the svg/png from this github issue, and it seems to render correctly in Chorme and Firefox...
2024-03-18_08-41-32_explorerDesktopexplorer.mp4
from cairosvg.
cool!, if i can ask, what was the command line you used?
cairosvg file.svg -o file.pdf -u
I’ve just changed the name of the PNG image in the SVG file so that it can it on disk.
That's weird, just to be sure i downloaded the svg/png from this github issue, and it seems to render correctly in Chorme and Firefox...
My bad, I don’t know what I’ve done with this image!
from cairosvg.
Thanks @liZe,
I ran it again, using your suggested command line prompt. I got the background image, but the text doesn't show up.
Ryan Schultz@DESKTOP-8GRDBJI MINGW64 /d/Dropbox/Gitea_OD/Highland_Haven/Open/Models_and_CAD/BlenderBIM/drawings (main)
$ cairosvg "D:/Dropbox/Gitea_OD/Highland_Haven/Open/Models_and_CAD/BlenderBIM/drawings/test.svg" -o "D:/Dropbox/Gitea_OD/Highland_Haven/Open/Models_and_CAD/BlenderBIM/drawings/testy5.pdf" -u
_cairo_win32_scaled_font_set_metrics:GetTextMetrics: The operation completed successfully.
Traceback (most recent call last):
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "C:\Python312\Scripts\cairosvg.exe\__main__.py", line 7, in <module>
File "C:\Python312\Lib\site-packages\cairosvg\__main__.py", line 78, in main
SURFACES[output_format.upper()].convert(**kwargs)
File "C:\Python312\Lib\site-packages\cairosvg\surface.py", line 133, in convert
instance = cls(
^^^^
File "C:\Python312\Lib\site-packages\cairosvg\surface.py", line 225, in __init__
self.draw(tree)
File "C:\Python312\Lib\site-packages\cairosvg\surface.py", line 472, in draw
self.draw(child)
File "C:\Python312\Lib\site-packages\cairosvg\surface.py", line 404, in draw
TAGS[node.tag](self, node)
File "C:\Python312\Lib\site-packages\cairosvg\text.py", line 69, in text
surface.context.font_extents())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python312\Lib\site-packages\cairocffi\context.py", line 1927, in font_extents
self._check_status()
File "C:\Python312\Lib\site-packages\cairocffi\context.py", line 107, in _check_status
_check_status(cairo.cairo_status(self._pointer))
File "C:\Python312\Lib\site-packages\cairocffi\__init__.py", line 87, in _check_status
raise exception(message, status)
cairocffi.CairoError: cairo returned CAIRO_STATUS_WIN32_GDI_ERROR: b'error occurred in the Windows Graphics Device Interface'
from cairosvg.
I suppose that it’s the same problem as #377. The bug is probably in Cairo: https://gitlab.freedesktop.org/cairo/cairo/-/issues/530
You can try to use another font and see if it works. I’ll be even easier if you can use a Linux computer.
If it doesn’t work, you can try to add a comment on Cairo’s issue and hope for an answer. 🤞🏽
from cairosvg.
Related Issues (20)
- `text` property `shape-inside` not respected HOT 1
- Convert to WebP HOT 1
- Add rlPyCairo to requirements.txt HOT 1
- Stroke Width is not taken into account for final height / width HOT 3
- OSE Error cairo-2 not found HOT 6
- Conversion of multiple files halted with error HOT 2
- SVG to PDF render improper PNG position HOT 1
- OSError: no library called "cairo-2" was found HOT 1
- RecursionError: maximum recursion depth exceeded in comparison HOT 1
- Truncating fractional height in pixels HOT 4
- svg2pdf incorrect width and height output - HOT 1
- Feature request: support style='background_color:xxxx' in the <svg> object
- Add support for blend modes
- svg2png the stroke attribute causes display anomalies. HOT 1
- Fail of image path resolution in a defs/use context HOT 1
- SVG path parse error
- ValueError: could not convert string to float: 'null' HOT 1
- ValueError: could not convert string to float: '' HOT 1
- Can't convert svg to pdf HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cairosvg.