Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
UlyssesZh opened this issue Aug 29, 2022 · 0 comments

Comments

@UlyssesZh
Copy link

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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant