Live data from Hacker News

Borb – A Python library to read, write, and edit PDF files

borbpdf.com

11–20 of 50 posts

Re: Borb – A Python library to read, write, and edit PDF files

#11
post #6

I am a math professor with a scanned exam grading workflow that I hacked together as Bash scripts using various open source command line tools. I feed all the exams through a sheet-fed scanner, decode bar codes to identify problems and students, add radio buttons for entering and tracking scores (0-6 per problem), and create PDF "books" per problem for grading and annotating. Having grad students help grade paper is…

> There are many evolutionary layers and no formal specification or verification;

There is a specification, but it's very complicated.

Re: Borb – A Python library to read, write, and edit PDF files

#12
post #2

Amazing, I've been yearning for something like this for years but have always been told it's impossible. Can't wait to try it

It is literally impossible for all PDFs, since some of them may not have any kind of semantic structure and consist of a set of graph bitmaps laid out at specific coordinates to make up blocks of text.

[deleted]

Re: Borb – A Python library to read, write, and edit PDF files

#13
post #11
post #6

I am a math professor with a scanned exam grading workflow that I hacked together as Bash scripts using various open source command line tools. I feed all the exams through a sheet-fed scanner, decode bar codes to identify problems and students, add radio buttons for entering and tracking scores (0-6 per problem), and create PDF "books" per problem for grading and annotating. Having grad students help grade paper is…

> There are many evolutionary layers and no formal specification or verification; There is a specification, but it's very complicated.

PDF uses postscript, which is Turing equivalent. It's a document format with the halting problem.

Re: Borb – A Python library to read, write, and edit PDF files

#14
post #2

Amazing, I've been yearning for something like this for years but have always been told it's impossible. Can't wait to try it

It is literally impossible for all PDFs, since some of them may not have any kind of semantic structure and consist of a set of graph bitmaps laid out at specific coordinates to make up blocks of text.

The best PDF bug is when the linker between the Adobe character value and the font/language is broken and you get random Unicode like values with no way to connect the two.

Infuriating.

Re: Borb – A Python library to read, write, and edit PDF files

#17
post #11

Earlier quoted context omitted.

> There are many evolutionary layers and no formal specification or verification; There is a specification, but it's very complicated.

PDF uses postscript, which is Turing equivalent. It's a document format with the halting problem.

That is not a realistic concern for GP. The scanned exams won't even involve any Postscript.

Re: Borb – A Python library to read, write, and edit PDF files

#18
So, are there decent lower-level (e.g. C++ or even C) libraries for doing this, which this library wraps? Or does this actually do the nitty-gritty PDF innards itself?

As for myself, I've not had to automate work on PDFs, luckily; for manual manipulation and annotation I've found Xournal++ sort of useful (https://xournalpp.github.io/). Inkscape can also be used with some questionable PDFs.

Re: Borb – A Python library to read, write, and edit PDF files

#19

So, are there decent lower-level (e.g. C++ or even C) libraries for doing this, which this library wraps? Or does this actually do the nitty-gritty PDF innards itself? As for myself, I've not had to automate work on PDFs, luckily; for manual manipulation and annotation I've found Xournal++ sort of useful ( https://xournalpp.github.io/ ). Inkscape can also be used with some questionable PDFs.

> or does this actually do the nitty-gritty PDF innards itself?

> with borb, a pure python library

Post reply on HN