GithubHelp home page GithubHelp logo

Comments (6)

liZe avatar liZe commented on June 9, 2024

Hello!

Here’s the PDF I get

out.pdf

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.

theoryshaw avatar theoryshaw commented on June 9, 2024

cool!, if i can ask, what was the command line you used?

from cairosvg.

theoryshaw avatar theoryshaw commented on June 9, 2024

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.

liZe avatar liZe commented on June 9, 2024

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!

out.pdf

from cairosvg.

theoryshaw avatar theoryshaw commented on June 9, 2024

Thanks @liZe,

I ran it again, using your suggested command line prompt. I got the background image, but the text doesn't show up.

2024-03-18_09-30-50_Revutesty5_-_Bluebeam_Revu_x64Revu

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.

liZe avatar liZe commented on June 9, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.