Giter Club home page Giter Club logo

ipe-tools's People

Contributors

acfbuerger avatar christian-kapeller avatar derwaldi avatar dietmarw avatar edporras avatar jbicha avatar liubenyuan avatar miccal avatar mortal avatar otfried avatar tinloaf avatar us91 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ipe-tools's Issues

annotate.py Python3 incompatible

Could it be possible to make annotate.py compatible with Python3?
Python3 complains about the triple quotes.

python3 annotate.py file.pdf
  File "annotate.py", line 31
    """)
SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 44-45: truncated \uXXXX escape

.bak file generated by annotate.py

running python3 ./ipe-tools/annotate/annotate.py file.pdf creates a .ipe file but also a .ipe.bak

output when running the script is:

Updating styles in figure 'annotate-main.ipe'
 - stylesheet 'basic'
     updating from '.ipe/styles/basic.isy'
 - standard stylesheet

pdftoipe compiling problem on Archlinux

When installing pdftoipe on Archlinux, using the PKGBUILD file ipe-tools-git from AUR, the following error was encountered:

pdftoipe.cpp: In function ‘int main(int, char**)’:
pdftoipe.cpp:103:53: error: no matching function for call to ‘PDFDoc::PDFDoc(GooString*&, GooString*&, GooString*&)’
  103 |   PDFDoc *doc = new PDFDoc(fileName, ownerPW, userPW);
      |                                                     ^
In file included from pdftoipe.cpp:20:
/usr/include/poppler/PDFDoc.h:371:5: note: candidate: ‘PDFDoc::PDFDoc()’
  371 |     PDFDoc();
      |     ^~~~~~
/usr/include/poppler/PDFDoc.h:371:5: note:   candidate expects 0 arguments, 3 provided
/usr/include/poppler/PDFDoc.h:139:14: note: candidate: ‘PDFDoc::PDFDoc(BaseStream*, const std::optional<GooString>&, const std::optional<GooString>&, void*, const std::function<void()>&)’
  139 |     explicit PDFDoc(BaseStream *strA, const std::optional<GooString> &ownerPassword = {}, const std::optional<GooString> &userPassword = {}, void *guiDataA = nullptr, const std::function<void()> &xrefReconstructedCallback = {});
      |              ^~~~~~
/usr/include/poppler/PDFDoc.h:139:33: note:   no known conversion for argument 1 from ‘GooString*’ to ‘BaseStream*’
  139 |     explicit PDFDoc(BaseStream *strA, const std::optional<GooString> &ownerPassword = {}, const std::optional<GooString> &userPassword = {}, void *guiDataA = nullptr, const std::function<void()> &xrefReconstructedCallback = {});
      |                     ~~~~~~~~~~~~^~~~
In file included from pdftoipe.cpp:20:
/usr/include/poppler/PDFDoc.h:132:14: note: candidate: ‘PDFDoc::PDFDoc(std::unique_ptr<GooString>&&, const std::optional<GooString>&, const std::optional<GooString>&, void*, const std::function<void()>&)’
  132 |     explicit PDFDoc(std::unique_ptr<GooString> &&fileNameA, const std::optional<GooString> &ownerPassword = {}, const std::optional<GooString> &userPassword = {}, void *guiDataA = nullptr,
      |              ^~~~~~
/usr/include/poppler/PDFDoc.h:132:50: note:   no known conversion for argument 1 from ‘GooString*’ to ‘std::unique_ptr<GooString>&&’
  132 |     explicit PDFDoc(std::unique_ptr<GooString> &&fileNameA, const std::optional<GooString> &ownerPassword = {}, const std::optional<GooString> &userPassword = {}, void *guiDataA = nullptr,
      |                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~
make: *** [<builtin>: pdftoipe.o] Error 1
==> ERROR: A failure occurred in build().
    Aborting...
The build failed.

  |                                             

Error at the end of a matplotlib plot using ipe backend

First of all what a wonderful tool you've developped! All my future figures will be plotted using your backend which can be more easily edited in ipe and integrated into my LaTeX document.

In some cases I encounter this error message at the end of the plotting (after the generation of .ipe files, so in fact harmless)

Exception TypeError: "'NoneType' object is not callable" in <bound method LatexManager.__del__ of <matplotlib.backends.backend_pgf.LatexManager instance at 0x7feb705631b8>> ignored

and I couldn't find out why...

pdftoipe fail to compile with poppler 22.12

It seems that the API for poppler has changed. The change causes pdftoipe to not compile, with the following message:

xmloutputdev.cpp:156:21: error: no matching function for call to ‘GfxState::getLineDash(double**, int*, double*)’
  156 |   state->getLineDash(&dash, &length, &start);
      |   ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/poppler/Gfx.h:40,
                 from xmloutputdev.cpp:13:
/usr/include/poppler/GfxState.h:1506:32: note: candidate: ‘const std::vector<double>& GfxState::getLineDash(double*)’
 1506 |     const std::vector<double> &getLineDash(double *start)
      |                                ^~~~~~~~~~~
/usr/include/poppler/GfxState.h:1506:32: note:   candidate expects 1 argument, 3 provided

Missing dependency in latest ipe deb package (Could not find the Qt platform plugin "xcb" in "")

This is not a bug report of IPE but a report of the .deb package. I think there is a missing dependency.

I just installed the new version of ipe 7.2.27 on a fresh installation of Ubuntu 22. That is, I downloaded the .deb package available in the web and issued the command

$ sudo gdebi ipe_7.2.27-1_amd64.deb 

The package has some dependencies that were automatically installed. In my system, at the moment of installation, these dependencies were

$ sudo gdebi ipe_7.2.27-1_amd64.deb 
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Reading state information... Done
Requires the installation of the following packages: libb2-1 liblua5.4-0 libqt6core6 libqt6dbus6 libqt6gui6 libqt6svg6 libqt6widgets6 qt6-gtk-platformtheme

The Ipe extensible drawing editor
 Ipe is a drawing editor for creating figures in PDF format.  It

Unfortunately, the installation of these dependencies were not enough and when I execute ipe I get the following error message

$ ipe
qt.qpa.plugin: Could not find the Qt platform plugin "xcb" in ""
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

This is not an issue since it can be fixed with

$ sudo apt install qt6-qpa-plugins

The apt package manager will install any remaining dependencies. I think the .deb package is missing this dependency and perhaps this last package qt6-qpa-plugins should be added to the list of dependencies.

Inconsistent Arrowtip handling

Hi,
while working on svgto ipe I've created an ipe file, last-arrow-missing.ipe

It contains 3 paths with arrow tips. The last path doesn't show the arrows.
Can you tell why this happens with current ipe 7.2.6?
The file uses the 'old' format, could that be the issue?

svgtoipe

First of all there is an easy workaround! For some reason svgtoipe can't read this svg file:

<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="40.21999999999997mm" height="17.110000000000014mm" viewBox="455.16 543.29 495.38 560.4"> <path stroke="black" fill="none" d="M456.28,544.52 456.28 544.52,456.23 544.48 C456.07 544.35,455.78 544.11,455.43 543.8 C455.18 543.48,455.16 543.29,455.4 543.29 C455.8 543.48,456.27 543.79,456.75 544.15 C457.24 544.49,457.75 544.81,458.32 545.12 C459.01 545.46,459.84 545.85,460.85 546.33 C462.09 546.9,463.58 547.55,465.36 548.25 C467.4 549.02,469.66 549.84,472.02 550.71 C474.39 551.63,476.72 552.58,478.98 553.54 C481.18 554.51,483.31 555.44,485.37 556.3 C487.32 557.07,489.1 557.74,490.67 558.34 C492.02 558.86,493.15 559.29,494.05 559.62 C494.72 559.86,495.16 560.04,495.33 560.17 C495.37 560.27,495.38 560.33,495.36 560.4 C495.36 560.4"/>
</svg>

The file was produced by https://github.com/ngmsoftware/will2svg
Now I use cairosvg to produce a new svg file which I can convert to an ipe file with svgtoipe.
I wasn't able to find out what svgtoipe didn't understand?

Cut a release tag

The old tools directory on the SF page seems to have been removed once the tools were moved here. Could you possibly cut a new tag here so we can continue to package pdftoipe? Thanks!

Issue with libpoppler shared library

Hello,

I have cloned the latest version (73f4cef) and tried to use pdftoipe, which fails giving the error

pdftoipe: error while loading shared libraries: libpoppler.so.85: cannot open shared object file: No such file or directory

On my system (arch linux) I have installed the latest version of the poppler package, which provides the file libpoppler.so.86 as a link to the library libpoppler.so.86.0.0. I have tried to create a link to the new library with the old name, but while the program starts, the conversion is messy (wrong size for text and lines).

I could downgrade the poppler package, but I was wondering if there was another solution.

Legend border size not adjusted

Maybe I'm the only active user of this ipe-matplotlib backend...

After the recent commits, I discover that now the legend border size is fixed and no more adjusted according to the description inside.

import matplotlib
matplotlib.use('module://backend_ipe')
import pylab as pl
matplotlib.rcParams['ipe.preamble'] = "\usepackage{newtxtext,newtxmath}"

x = pl.linspace(0, 1, 100)
pl.plot(x, pl.sin(x), label="It is a label")
pl.legend(loc="best")
pl.savefig("test.ipe", format="ipe")

ipe

annotate does not work after upgrading to Python 3.6

python3 --version returns Python 3.6.0
pip3 install --upgrade PyPDF2 returns Requirement already up-to-date: PyPDF2 in /usr/local/lib/python3.6/site-packages

However, the previously working annotate.py script now returns

python ./annotate.py X.pdf
Traceback (most recent call last):
  File "./annotate.py", line 6, in <module>
    import PyPDF2 as pdf
ImportError: No module named PyPDF2

iPython support?

Hi,

not sure if it should count as a real issue, more of a wish or just putting this information out for other people. I am using matplotlib version 1.4.2 in Spyder 2.3.5.2, which uses iPython for compiling by default. After noticing that I could directly export my figures directly to my favorite graphical format, I was really thrilled, but I was still getting the following error:

runfile('/home/michal/.spyder2/temp.py', wdir='/home/michal/.spyder2')
Traceback (most recent call last):

  File "<ipython-input-5-2d271459364a>", line 1, in <module>
    runfile('/home/michal/.spyder2/temp.py', wdir='/home/michal/.spyder2')

  File "/usr/lib/python2.7/dist-packages/spyderlib/widgets/externalshell/sitecustomize.py", line 685, in runfile
    execfile(filename, namespace)

  File "/usr/lib/python2.7/dist-packages/spyderlib/widgets/externalshell/sitecustomize.py", line 78, in execfile
    builtins.execfile(filename, *where)

  File "/home/michal/.spyder2/temp.py", line 14, in <module>
    plt.savefig("my_plot.ipe", format="ipe")

  File "/usr/lib/python2.7/dist-packages/matplotlib/pyplot.py", line 577, in savefig
    res = fig.savefig(*args, **kwargs)

  File "/usr/lib/python2.7/dist-packages/matplotlib/figure.py", line 1470, in savefig
    self.canvas.print_figure(*args, **kwargs)

  File "/usr/lib/python2.7/dist-packages/matplotlib/backend_bases.py", line 2102, in print_figure
    canvas = self._get_output_canvas(format)

  File "/usr/lib/python2.7/dist-packages/matplotlib/backend_bases.py", line 2044, in _get_output_canvas
    '%s.' % (format, ', '.join(formats)))

ValueError: Format "ipe" is not supported.
Supported formats: eps, jpeg, jpg, pdf, pgf, png, ps, raw, rgba, svg, svgz, tif, tiff.

Which I figured was just the backend not loading. After I have put the backend into every possible place, a colleague (who was failing to reproduce my problem, since he was just using python in console) noticed that I was using iPython for compiling. After switching to Python, the problem was gone.

Issue after upgrading to fedora 36 gnome

If i try to open in fedora 36 gnome

I get the following error:
usr/include/c++/12/bits/stl_vector.h:1122: std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator [with _Tp = ipe::String; _Alloc = std::allocatoripe::String; reference = ipe::String&; size_type = long unsigned int]: Assertion '__n < this->size()' failed.
Aborted (core dumped)

Is there anything I do to resolve the issue. Any suggestions would be helpful

svgtoipe: Warnings when converting output from Graphviz

ipe-tools/svgtoipe/svgtoipe.py:130: SyntaxWarning: invalid escape sequence '\.'
  return re.findall("([A-Za-z]|-?[0-9]+\.?[0-9]*(?:e-?[0-9]*)?)", string)
ipe-tools/svgtoipe/svgtoipe.py:181: SyntaxWarning: invalid escape sequence '\.'
  d = re.findall("([A-Za-z]|-?(?:\.[0-9]+|[0-9]+\.?[0-9]*)(?:e-?[0-9]+)?)", d)
ipe-tools/svgtoipe/svgtoipe.py:275: SyntaxWarning: invalid escape sequence '\('
  d = re.findall("[a-zA-Z]+\([^)]*\)", txt)
ipe-tools/svgtoipe/svgtoipe.py:701: SyntaxWarning: invalid escape sequence '\('
  mat = re.match("url\(#([^)]+)\).*", fill)
ipe-tools/svgtoipe/svgtoipe.py:936: SyntaxWarning: invalid escape sequence '\('
  mat = re.match("url\(#([^)]+)\).*", node.getAttribute("clip-path"))
Unhandled node: title
Unhandled node: title
Unhandled node: title
Unhandled node: title
Unhandled node: title

SVG input triggering the above output:
L2min

annotate.py feature request

Since the purpose is to annotate a given PDF, it seems reasonable and useful that, by default,
each PDF page is enclosed in a locked layer and annotation are added to another one.
This prevents, for instance, accidental deletion of the PDF page.

parsing error

I had produced an ipe file a year ago and now I cannot open the file. I realized that, the producer of the file was changed to Mac OS X 10.10.1 Quartz PDFContext. And as you mentioned in one of your comments, the file is probably not recoverable anymore. Then, I have tried to use pdftoipe, however, when I wanna open the ipe file, I receive a parsing error. Could you please kindly help me with the issue. I have attached the file here:
0.pdf

Bests,

svgtoipe ValueError

Hi! Could you help me what could be wrong? Does my svg have some issue in path definition? It seems right with Preview on mac.

Output of the command:

Traceback (most recent call last):
  File "svgtoipe.py", line 1042, in <module>
    main()
  File "svgtoipe.py", line 1037, in main
    svg.parse_svg(args.outfile)
  File "svgtoipe.py", line 441, in parse_svg
    self.write_data()
  File "svgtoipe.py", line 458, in write_data
    self.parse_nodes(self.root)
  File "svgtoipe.py", line 470, in parse_nodes
    getattr(self, nodeName)(n)
  File "svgtoipe.py", line 976, in node_path
    parse_path(self.out, d)
  File "svgtoipe.py", line 184, in parse_path
    x1, y1 = pnext(d, 2)
  File "svgtoipe.py", line 156, in pnext
    l.append(float(d.pop(0)))
ValueError: could not convert string to float: L

Here is an example path from the svg file

<path d="M101 0a4.68 4.68 0 0 0-1.19.17l-.64.28L100.74 7l-22.89.05C63.55 7.1 47.31 5 35.13 5.33s-27.9 5.14-27.9 5.14l-2.51.69C1.19 12.13 0 29 0 41.75v1.23C0 55.72 1.19 72.6 4.72 73.57l2.51.7S23 79 35.13 79.4s28.42-1.77 42.72-1.74h22.89l-1.59 6.57.64.28a4.27 4.27 0 0 0 1.19.17 2.85 2.85 0 0 0 .49 0h.17l.18-.05.34-.13a2.6 2.6 0 0 0 .88-.6 1.37 1.37 0 0 0 .27-.42l2.23-5.73h20.16c4.39 2.19 8.35 2 13.5 2 24.44 0 34.41-15.88 34.3-36.93v-.43-.43C173.61 20.88 163.64 5 139.2 5c-5.15 0-9.11-.22-13.5 2h-20.16l-2.23-5.74a1.22 1.22 0 0 0-.31-.39 2.6 2.6 0 0 0-.88-.6l-.34-.13h-.35A2.15 2.15 0 0 0 101 0z" fill="#53a1d9"/>

How to run figtoipe

How to run figtoipe on mac os (10.14.2)? After compiling a copy executable file to ipe app (Macintosh HD⁩ ▸ ⁨Applications⁩ ▸ ⁨Ipe⁩ ▸ ⁨Contents⁩) it doesn't working. I also tried run figtoipe from terminal. What is the right procedure? Thank you and sorry for stupid question (I am only user).

pdftoipe incompatible with poppler 0.83

There were issues with upgrading poppler to 0.82 on Homebrew, and compiling it against 0.83 results in:

$ make
clang++ -Wno-write-strings -std=c++11 -I/usr/local/Cellar/poppler/0.83.0/include/poppler  -c -o parseargs.o parseargs.cc
clang++ -Wno-write-strings -std=c++11 -I/usr/local/Cellar/poppler/0.83.0/include/poppler  -c -o xmloutputdev.o xmloutputdev.cpp
clang++ -Wno-write-strings -std=c++11 -I/usr/local/Cellar/poppler/0.83.0/include/poppler  -c -o pdftoipe.o pdftoipe.cpp
xmloutputdev.cpp:201:12: error: cannot initialize a variable of type 'GfxPath *' with an rvalue of type 'const GfxPath *'
  GfxPath *path = state->getPath();
           ^      ~~~~~~~~~~~~~~~~
1 error generated.
make: *** [xmloutputdev.o] Error 1
make: *** Waiting for unfinished jobs....
pdftoipe.cpp:82:16: error: no viable overloaded '='
  globalParams = new GlobalParams();
  ~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/usr/include/c++/v1/memory:2347:28: note: candidate function (the implicit copy assignment operator)
      not viable: no known conversion from 'GlobalParams *' to 'const std::__1::unique_ptr<GlobalParams,
      std::__1::default_delete<GlobalParams> >' for 1st argument
class _LIBCPP_TEMPLATE_VIS unique_ptr {
                           ^
/Library/Developer/CommandLineTools/usr/include/c++/v1/memory:2463:15: note: candidate function not viable: no known conversion from
      'GlobalParams *' to 'std::__1::unique_ptr<GlobalParams, std::__1::default_delete<GlobalParams> >' for 1st argument
  unique_ptr& operator=(unique_ptr&& __u) _NOEXCEPT {
              ^
/Library/Developer/CommandLineTools/usr/include/c++/v1/memory:2555:15: note: candidate function not viable: no known conversion from
      'GlobalParams *' to 'std::nullptr_t' (aka 'nullptr_t') for 1st argument
  unique_ptr& operator=(nullptr_t) _NOEXCEPT {
              ^
/Library/Developer/CommandLineTools/usr/include/c++/v1/memory:2474:15: note: candidate template ignored: could not match
      'unique_ptr<type-parameter-0-0, type-parameter-0-1>' against 'GlobalParams *'
  unique_ptr& operator=(unique_ptr<_Up, _Ep>&& __u) _NOEXCEPT {
              ^
/Library/Developer/CommandLineTools/usr/include/c++/v1/memory:2545:7: note: candidate template ignored: could not match
      'auto_ptr<type-parameter-0-0>' against 'GlobalParams *'
      operator=(auto_ptr<_Up> __p) {
      ^
pdftoipe.cpp:156:3: error: cannot delete expression of type 'std::unique_ptr<GlobalParams>'
  delete globalParams;
  ^      ~~~~~~~~~~~~
2 errors generated.
make: *** [pdftoipe.o] Error 1

Compatibility with the new matplotlib 2.0.0?

On a minimal example

x = linspace(0, 2*pi, 1000)
y = sin(x)
plot(x, y)
savefig("test.ipe")

I had the following error with the new matplotlib 2.0.0

  File "/usr/local/lib/python2.7/site-packages/matplotlib/pyplot.py", line 697, in savefig
    res = fig.savefig(*args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/matplotlib/figure.py", line 1572, in savefig
    self.canvas.print_figure(*args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/matplotlib/backend_bases.py", line 2244, in print_figure
    **kwargs)
  File "/usr/local/hpc/ipe-tools/matplotlib/backend_ipe.py", line 474, in print_ipe
    return self._print_ipe(filename, ipewriter, fh_to_close, **kwargs)
  File "/usr/local/hpc/ipe-tools/matplotlib/backend_ipe.py", line 482, in _print_ipe
    self.figure.draw(renderer)
  File "/usr/local/lib/python2.7/site-packages/matplotlib/artist.py", line 63, in draw_wrapper
    draw(artist, renderer, *args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/matplotlib/figure.py", line 1140, in draw
    self.patch.draw(renderer)
  File "/usr/local/lib/python2.7/site-packages/matplotlib/artist.py", line 63, in draw_wrapper
    draw(artist, renderer, *args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/matplotlib/patches.py", line 561, in draw
    renderer.draw_path(gc, tpath, affine, rgbFace)
  File "/usr/local/hpc/ipe-tools/matplotlib/backend_ipe.py", line 293, in draw_path
    dashes = "[" + " ".join(["%g" % x for x in dl]) + "] %g" % offs
TypeError: 'NoneType' object is not iterable

Failed compilation of pdftoipe V7.2.24.1; Sep 08, 2021

Compiling the current version of pdftoipe (V7.2.24.1; Sep 08, 2021) against the current version of poppler (stable 22.08.0) fails with API mismatches ("no matching constructor", "candidate constructor not viable").

That's to be expected, since pdftoipe's documentation (ipe-tools/pdftoipe/readme.txt) specifies that poppler version v0.86.0 is needed.

The simple solution is to install 0.86 of poppler from https://poppler.freedesktop.org/releases.html, but doing so requires a cascade of dependency adjustments. I'm not sure yet whether it's possible to install poppler 0.86 using macports or brew.

svgtoipe for gradients

At https://otfried.github.io/ipe/70_presentations.html#gradient-patterns it is advised to use inkscape to create a gradient and than convert it to ipe using svgtoipe.py. However, after converting the svg below, the gradient is gone. (Note: the original svg has an intendation of 3 spaces per tab instead of 4 spaces per tab).

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->

<svg
    xmlns:dc="http://purl.org/dc/elements/1.1/"
    xmlns:cc="http://creativecommons.org/ns#"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:svg="http://www.w3.org/2000/svg"
    xmlns="http://www.w3.org/2000/svg"
    xmlns:xlink="http://www.w3.org/1999/xlink"
    xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
    xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
    width="210mm"
    height="297mm"
    viewBox="0 0 210 297"
    version="1.1"
    id="svg8"
    inkscape:version="0.92.5 (2060ec1f9f, 2020-04-08)"
    sodipodi:docname="gradient.svg">
  <defs
      id="defs2">
     <linearGradient
         inkscape:collect="always"
         id="linearGradient855">
        <stop
            style="stop-color:#fc8a03;stop-opacity:1;"
            offset="0"
            id="stop851" />
        <stop
            id="stop859"
            offset="0.65925938"
            style="stop-color:#fc8a03;stop-opacity:0.51764706;" />
        <stop
            style="stop-color:#fc8a03;stop-opacity:0;"
            offset="1"
            id="stop853" />
     </linearGradient>
     <linearGradient
         inkscape:collect="always"
         id="linearGradient829">
        <stop
            style="stop-color:#efb806;stop-opacity:1"
            offset="0"
            id="stop825" />
        <stop
            id="stop833"
            offset="0.65157384"
            style="stop-color:#44ef06;stop-opacity:0.44705883" />
        <stop
            style="stop-color:#efbf06;stop-opacity:0;"
            offset="1"
            id="stop827" />
     </linearGradient>
     <radialGradient
         inkscape:collect="always"
         xlink:href="#linearGradient829"
         id="radialGradient835"
         cx="104.32143"
         cy="130.69048"
         fx="104.32143"
         fy="130.69048"
         r="45.357143"
         gradientUnits="userSpaceOnUse"
         gradientTransform="matrix(0.98333342,0,0,1,1.7386816,0)" />
     <radialGradient
         inkscape:collect="always"
         xlink:href="#linearGradient855"
         id="radialGradient857"
         cx="110.74702"
         cy="151.85713"
         fx="110.74702"
         fy="151.85713"
         r="51.026787"
         gradientTransform="matrix(1,0,0,0.99259261,0,1.1248655)"
         gradientUnits="userSpaceOnUse" />
  </defs>
  <sodipodi:namedview
      id="base"
      pagecolor="#ffffff"
      bordercolor="#666666"
      borderopacity="1.0"
      inkscape:pageopacity="0.0"
      inkscape:pageshadow="2"
      inkscape:zoom="0.35"
      inkscape:cx="-101.42857"
      inkscape:cy="548.57143"
      inkscape:document-units="mm"
      inkscape:current-layer="layer1"
      showgrid="false"
      inkscape:window-width="1848"
      inkscape:window-height="1016"
      inkscape:window-x="1992"
      inkscape:window-y="27"
      inkscape:window-maximized="1" />
  <metadata
      id="metadata5">
     <rdf:RDF>
        <cc:Work
            rdf:about="">
          <dc:format>image/svg+xml</dc:format>
          <dc:type
              rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
          <dc:title></dc:title>
        </cc:Work>
     </rdf:RDF>
  </metadata>
  <g
      inkscape:label="Layer 1"
      inkscape:groupmode="layer"
      id="layer1">
     <ellipse
         style="opacity:1;fill:url(#radialGradient857);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.79374999;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
         id="path849"
         cx="110.74702"
         cy="151.85713"
         rx="51.026787"
         ry="50.648811" />
  </g>
</svg>

gradient

Matplotlib backend problem

Hi,

I am having the issue when I am trying to use the ipe backend for matplotlib. I am on Python 3.11 and matplotlib 3.8.3

ImportError: cannot import name 'maxdict' from 'matplotlib.cbook

Anyone managed to solve it?

Thanks

svgtoipe: Support for Arrowtips

I've hacked together code for parsing and writing arrows in svg files. See this commit in my svg-markers branch.

Collecting and writing marker/arrow definitions seems to work. Still I am doing something wrong, as the arrows won't show when loaded with ipe release 7.2.6.

svgtoipe doesn't use the new stylesheet format. But as I understand it, the following fragments should suffice to produce arrowed paths

Within styesheets define the symbol:
<ipestyle> <symbol name="Arrow1Lend" xform="yes"> <path matrix="-0.8 0 0 -0.8 -10 0" stroke="0 0 0" filltest-markers="0 0 0" pen="1"> 0 0 m 5 -5 l -12.5 0 l 5 5 l h </path> </symbol> <ipestyle>

And later in the document use those symbol:
<path stroke="black" arror="Arrow1Lend" rarror="Arrow1Lend"> 81 130 m 120 130 l </path>

Could you help me to clarify that issue?

Multiple figures

The following code produces a ValueError: I/O operation on closed file during the second savefig (the first figure is well saved, the second test2.ipe is created but unreadable). Thanks for your help.

import matplotlib
matplotlib.use('module://backend_ipe')
import pylab as pl
matplotlib.rcParams['ipe.preamble'] = "\usepackage{newtxtext,newtxmath}"
matplotlib.rcParams['ipe.textsize'] = True

x = pl.linspace(0, pl.pi, 100)

pl.figure(1)
pl.plot(x, pl.sin(x), label="It is a label")
pl.legend(loc="best")
pl.savefig("test1.ipe", format="ipe")

pl.figure(2)
pl.plot(x, pl.cos(x), label="It is a label")
pl.legend(loc="best")
pl.savefig("test2.ipe", format="ipe")

poppler 0.59.0 incompatibility

Tested with ipe-tools 7.2.7 and HEAD @ baf4717.

clang++ -Wno-write-strings -I/usr/local/Cellar/poppler/0.59.0/include/poppler  -c -o xmloutputdev.o xmloutputdev.cpp
In file included from xmloutputdev.cpp:9:
/usr/local/Cellar/poppler/0.59.0/include/poppler/Object.h:326:45: error: rvalue reference to type
      'Object' cannot bind to lvalue of type 'Object'
  { OBJECT_TYPE_CHECK(objArray); array->add(std::move(elem)); }
                                            ^~~~~~~~~~~~~~~
/usr/local/Cellar/poppler/0.59.0/include/poppler/Array.h:60:21: note: passing argument to parameter
      'elem' here
  void add(Object &&elem);
                    ^
In file included from xmloutputdev.cpp:9:
/usr/local/Cellar/poppler/0.59.0/include/poppler/Object.h:347:48: error: rvalue reference to type
      'Object' cannot bind to lvalue of type 'Object'
  { OBJECT_TYPE_CHECK(objDict); dict->add(key, std::move(val)); }
                                               ^~~~~~~~~~~~~~
/usr/local/Cellar/poppler/0.59.0/include/poppler/Dict.h:64:32: note: passing argument to parameter
      'val' here
  void add(char *key, Object &&val);
                               ^
In file included from xmloutputdev.cpp:9:
/usr/local/Cellar/poppler/0.59.0/include/poppler/Object.h:350:48: error: rvalue reference to type
      'Object' cannot bind to lvalue of type 'Object'
  { OBJECT_TYPE_CHECK(objDict); dict->set(key, std::move(val)); }
                                               ^~~~~~~~~~~~~~
/usr/local/Cellar/poppler/0.59.0/include/poppler/Dict.h:68:38: note: passing argument to parameter
      'val' here
  void set(const char *key, Object &&val);
                                     ^
In file included from xmloutputdev.cpp:15:
/usr/local/Cellar/poppler/0.59.0/include/poppler/Page.h:113:16: error: overload resolution selected
      deleted operator '='
  {  resources = std::move(obj1); }
     ~~~~~~~~~ ^ ~~~~~~~~~~~~~~~
/usr/local/Cellar/poppler/0.59.0/include/poppler/Object.h:173:11: note: candidate function has been
      explicitly deleted
  Object &operator=(const Object &other) = delete;
          ^
/usr/local/Cellar/poppler/0.59.0/include/poppler/Object.h:171:11: note: candidate function not
      viable: no known conversion from 'Object' to 'Object &&' for 1st argument
  Object& operator=(Object&& other);
          ^
4 errors generated.
make: *** [xmloutputdev.o] Error 1

Here is the complete log: https://gist.github.com/ilovezfs/6ac7f7dbb09aa394660b63b75b8cca48

HOMEBREW_VERSION: 1.3.2
ORIGIN: https://github.com/Homebrew/brew
HEAD: 751334a257d81851e68da7ab390982d4e9fdf909
Last commit: 51 minutes ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: d1fbe2616bbe8f79345acb1b64a90e07add0fa86
Core tap last commit: 44 minutes ago
HOMEBREW_PREFIX: /usr/local
HOMEBREW_REPOSITORY: /usr/local/Homebrew
HOMEBREW_CELLAR: /usr/local/Cellar
HOMEBREW_BOTTLE_DOMAIN: https://homebrew.bintray.com
CPU: octa-core 64-bit skylake
Homebrew Ruby: 2.0.0-p648 => /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.0.0-p648/bin/ruby
Clang: 8.0 build 800
Git: 2.10.1 => /Applications/Xcode.app/Contents/Developer/usr/bin/git
Perl: /usr/bin/perl
Python: /usr/local/opt/python/libexec/bin/python => /usr/local/Cellar/python/2.7.13_1/Frameworks/Python.framework/Versions/2.7/bin/python2.7
Ruby: /usr/local/bin/ruby => /usr/local/Cellar/ruby/2.4.1_1/bin/ruby
Java: 1.8.0_121, 1.7.0_154-zulu-7.20.0.3
macOS: 10.11.6-x86_64
Xcode: 8.2.1
CLT: 8.2.0.0.1.1480973914
X11: 2.7.11 => /opt/X11

Colorize closed path composed by parts

I want to colorize the inner side of a closed path composed of three circular arcs. I am not able to find a native way to do it. You may find the XML content in the following file lilium.txt.

Best regards

Failed compilation of pdftoipe (Poppler 22.12.0)

Both with and without #48 I'm getting

xmloutputdev.cpp:156:21: error: no matching function for call to 'GfxState::getLineDash(double**, int*, double*)'
  156 |   state->getLineDash(&dash, &length, &start);
      |   ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~

Even #55 did not help and produced

pdftoipe.cpp:103:53: error: no matching function for call to 'PDFDoc::PDFDoc(GooString*&, GooString*&, GooString*&)'
  103 |   PDFDoc *doc = new PDFDoc(fileName, ownerPW, userPW);
      |

pdftoipe: texts are not included in generated xml file

Hi, I am using the debian versions of pdftoipe. When using 7.2.20 (I do not know if it corresponds with the last git version), no text is included in the generated xml file. When using an older version, 7.2.7.2, all texts are included as expected, depending on the selected options. I am testing it with pdf files obtained from MATLAB plots.

Trouble compiling pdftoipe

The direct route on macOS (install brew: https://brew.sh/; install pkg-config: brew install pkg-config; install Poppler 23.06: brew install poppler; https://formulae.brew.sh/formula/poppler; 'make'), fails with:

xmloutputdev.cpp:156:29: error: too many arguments to function call, expected single argument 'start', have 3 arguments

Compiling Poppler 0.86 (https://poppler.freedesktop.org/releases.html) with Apple's cc (clang version 14.0.3) fails with:

/usr/local/poppler-0.86.1/glib/poppler-action.cc:28:1: error: cannot initialize a parameter of type 'unsigned long ' with an rvalue of type 'typename std::remove_reference<decltype((&g_define_type_id__volatile))>::type *' (aka 'volatile unsigned long *')

Parsing Error

I have a graph saved as a .pdf. Anytime I run pdftoipe on the pdf this generates an .ipe file which I then try to open with IPE, only to recieve the following error:

document "file.ipe" could not be opened

Parsing error at position 210

when I open the .ipe file there is no clear position 210, only a giant string of hex.

Problem compiling against poppler 0.82.0

I'm trying to build this on ArchLinux, which currently has poppler 0.82.0, and I'm getting the following errors:

g++ -Wno-write-strings -std=c++14 -I/usr/include/poppler   -c -o xmloutputdev.o xmloutputdev.cpp
xmloutputdev.cpp: In member function ‘void XmlOutputDev::doPath(GfxState*)’:
xmloutputdev.cpp:209:33: error: passing ‘const GfxPath’ as ‘this’ argument discards qualifiers [-fpermissive]
  209 |     subpath = path->getSubpath(i);
      |                                 ^
In file included from /usr/include/poppler/Gfx.h:39,
                 from xmloutputdev.cpp:13:
/usr/include/poppler/GfxState.h:1329:15: note:   in call to ‘GfxSubpath* GfxPath::getSubpath(int)’
 1329 |   GfxSubpath *getSubpath(int i) { return subpaths[i]; }
      |               ^~~~~~~~~~
make: *** [<builtin>: xmloutputdev.o] Error 1

and

g++ -Wno-write-strings -std=c++14 -I/usr/include/poppler   -c -o pdftoipe.o pdftoipe.cpp
pdftoipe.cpp: In function ‘int main(int, char**)’:
pdftoipe.cpp:83:48: error: cannot convert ‘std::_MakeUniq<GlobalParams>::__single_object’ {aka ‘std::unique_ptr<GlobalParams, std::default_delete<GlobalParams> >’} to ‘GlobalParams*’ in assignment
   83 |   globalParams = std::make_unique<GlobalParams>();
      |                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
      |                                                |
      |                                                std::_MakeUniq<GlobalParams>::__single_object {aka std::unique_ptr<GlobalParams, std::default_delete<GlobalParams> >}
make: *** [<builtin>: pdftoipe.o] Error 1

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.