GithubHelp home page GithubHelp logo

gists's People

Contributors

oxplot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

gists's Issues

Make an automated svglinkify with no manual intervention needed

Proposed command line usage:

svglinkify input.svg output.pdf [--pdf-version pdf-version]

svglinkify should inspect the SVG, add visual markers to all components with hyperlinks, export to PDF, add links to PDF and write it out.

--pdf-version is equivalent to inkscape's --export-pdf-version command line arg.

svglinkify.py doesn't seem to work if there are other rectangles with non-white fill in front of magenta rectangles

I understand this is a big hack, but really appreciate you came up with this piece of code.

I don't know the internals of how Inkscape (using lib cairo?) converts SVGs to PDF but it seems like the technique you have to use for this to work only works for me if I have text that has a white rectangle behind it. Other areas I would want to create links in are in front of a rectangle with black background and others are in front of a rectangle with a semi-transparent pattern as a fill.

Any insight into how this could be affecting the code and the workaround? I followed instructions to the tee regarding moving the rectangles around and grouping,etc. Also, the fact that I got some links to work, and all of them being on top of a white rectangle leads me to believe there is a connection with that.

I've looked at the code heavily and the main regex which grabs links from combinations doesn't seem like it would mind if there are other rectangles that don't match this pattern somewhere 'above' or 'below' the ones that do. Maybe move things to another layer?

I am willing to help debug this as the tool helped me out tremendously but would be even more useful if it doesn't have these current limitations.

svglinkify.py does not work in Ubuntu 18.04 / libpoppler 0.62

Using svglinkify.py with the version of Inkscape (0.92.3-1) + dependencies (likely most importantly libpoppler 0.62) distributed in Ubuntu 18.04 results in a pdf with no clickable links.

svglinkify.py runs without reporting errors. If I add a print statement showing the rectangles, it seem to find them ok. Still, the generated output just misses the clickable links. However, if I keep everything the same, still running svglinkify.py on Ubuntu 18.04, but, I use a pdf file generated from Inkspace + dependencies running on Ubuntu 17.10, the links show up as desired.

Downgrading Inkscape itself to the exact version from Ubuntu 17.10 (0.92.2-1build1) did not resolve the issue. Hence, I suspect it is a change that has happened between libpoppler68 (v 0.57) and libpoppler73 (v 0.62).

A workaround is to generate the pdf used for svglinkify using the inkscape version in the snap store instead, i.e., install it with;

  sudo snap install inkscape

and run it with:

  snap run inkscape

This version uses libpoppler58 (v 0.41) and everything seems to be working with this.

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.