Git Product home page Git Product logo

pdftowrite's People

Contributors

kosmospredanie avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

pdftowrite's Issues

'type' is not scriptable

Using python3.7, when I run this I get

Traceback (most recent call last):
  File "/usr/local/bin/pdftowrite", line 5, in <module>
    from pdftowrite.pdftowrite import main
  File "/usr/local/lib/python3.7/site-packages/pdftowrite/pdftowrite.py", line 5, in <module>
    import pdftowrite.utils as utils
  File "/usr/local/lib/python3.7/site-packages/pdftowrite/utils.py", line 16, in <module>
    def apply_vars(text: str, vars: dict[str,Any]) -> str:
TypeError: 'type' object is not subscriptable

Output svgz file makes Write crash (segmentation fault)

Here is the PDF file that I wanted to convert. Open the output file with Write and scroll to page 8 will make Write crash. Writing some strokes on page 7 and saving the file will also make Write crash. The message output by Write in the console is

[1]    2758388 segmentation fault (core dumped)  Write

Not sure whether this is a bug of Write.
Environment:

  • OS: Ubuntu 20.04
  • Python 3.10.6
  • pdftowrite 2021.05.03
  • Inkscape 1.2.2 (1:1.2.2+202212051550+b0a8486541)

modul typing throws error

Hello,
I use debian10 with python 3.7. After installation with pip the programm throws an error

def apply_vars(text: str, vars: dict[str,Any] -> str
TypeError: 'type' object is not subscriptable

I think this comes from the modul typing . In the documentation of typing it is Dict[] with capital letter.

I tried then on ubuntu21.04 . There is the other syntax accepted.

What is the reason for failure on debian10?

Sincerely, Helge

Error when converting PDF generated by pdfLaTeX if there are big vertical lines

How to reproduce:

echo '\documentclass{article}\\begin{document}$\\big|$\\end{document}' | pdflatex
pdftowrite texput.pdf

The error:

Traceback (most recent call last):
  File "/home/ulysses/.pyenv/versions/3.10.6/bin/pdftowrite", line 8, in <module>
    sys.exit(main())
  File "/home/ulysses/.pyenv/versions/3.10.6/lib/python3.10/site-packages/pdftowrite/pdftowrite.py", line 187, in main
    run(sys.argv[1:])
  File "/home/ulysses/.pyenv/versions/3.10.6/lib/python3.10/site-packages/pdftowrite/pdftowrite.py", line 164, in run
    pages = loop.run_until_complete( convert_to_pages(filename, page_nums, ns) )
  File "/home/ulysses/.pyenv/versions/3.10.6/lib/python3.10/asyncio/base_events.py", line 646, in run_until_complete
    return future.result()
  File "/home/ulysses/.pyenv/versions/3.10.6/lib/python3.10/site-packages/pdftowrite/pdftowrite.py", line 114, in convert_to_pages
    result = await asyncio.gather(*tasks)
  File "/home/ulysses/.pyenv/versions/3.10.6/lib/python3.10/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/home/ulysses/.pyenv/versions/3.10.6/lib/python3.10/site-packages/pdftowrite/pdftowrite.py", line 104, in process_page
    return Background(page_num, svg, text_layer_svg, not ns.no_compat_mode)
  File "/home/ulysses/.pyenv/versions/3.10.6/lib/python3.10/site-packages/pdftowrite/docs.py", line 70, in __init__
    self.__process_svg(svg, text_layer_svg, compat_mode, uniquify)
  File "/home/ulysses/.pyenv/versions/3.10.6/lib/python3.10/site-packages/pdftowrite/docs.py", line 92, in __process_svg
    self.text_layer = self.__create_text_layer(text_layer_svg)
  File "/home/ulysses/.pyenv/versions/3.10.6/lib/python3.10/site-packages/pdftowrite/docs.py", line 284, in __create_text_layer
    tree = ET.ElementTree( ET.fromstring(text_layer_svg) )
  File "/home/ulysses/.pyenv/versions/3.10.6/lib/python3.10/xml/etree/ElementTree.py", line 1342, in XML
    parser.feed(text)
xml.etree.ElementTree.ParseError: not well-formed (invalid token): line 24, column 22

Environment:

  • OS: Ubuntu 20.04.4 LTS
  • Python: 3.10.6
  • pdftowrite: 2021.5.3
  • Inkscape: 1.2 (1:1.2.1+202207142221+cd75a1ee6d)
  • TeX: 3.14159265 (TeX Live 2019/Debian)

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.