apebl / pdftowrite Goto Github PK
View Code? Open in Web Editor NEWAnnotate PDFs with Stylus Labs Write
License: MIT License
Annotate PDFs with Stylus Labs Write
License: MIT License
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:
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
See wkhtmltopdf/wkhtmltopdf#5160 for context. Consider using an alternative to that.
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:
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.