PDF to notes [Support thread]

Using the poppler library (https://poppler.freedesktop.org/) the add-on converts a PDF file into notes.

  • Question/prompt extracted from each page (the first line of text)
  • Convert PDF pages to separate “normal” (front/back) notes or separate clozes in a single cloze type note.
  • PDF pages inserted as images or HTML (using poppler pdftoppm and pdftohtml).

a1

a2

a4

  • Deck: Which deck the added note(s) will be inserted into
  • Note type: Which note type to use for insertion, supports “normal” (front/back) note types as well as cloze note types.
  • Front (“normal” (front/back) note type): Which field to insert the “question” (first line of text in the page) in.
  • Back (“normal” (front/back) note type): Which field to insert the “answer” in.
  • Title field (cloze note type): Which field to insert PDF file name as title (for note types, such as the built-in cloze, that do not have a suitable field for this, select <none>).
  • Cloze field (cloze note type): Which field to insert clozes into. Clozes are inserted as prompt: {{c1::<br>answer}}<br> where prompt is the first line of text extracted from the page and answer is either an image of the page or a <div> with the page HTML.
  • Format: Format to insert the pages in, either as images (will preserve exact layout and work well on all screen sizes but no editable/selectable text) or HTML (does not give perfect results on any screen, especially not small screens but text can be copied/edited).

INSTALLATION

1 Like

On linux I got
[Errno 2] No such file or directory: ‘/tmp/tmp5hp11s3m/pgtxt.txt’

Ok, could you run Anki from bash and see what you get from stderr? pgtxt.txt is the temp file that subprocess.run([PDFTOTXT, "-layout", pdf, tmp_file], stdout=subprocess.PIPE, universal_newlines=True, shell=True) is supposed to write to so I am guessing that fails for some reason. You are certain you have pdftotext installed an in the path?

This addon is very good, but please make a feature where you can make one page of the pdf the front and one page the back or even one pdf be all the front and one pdf all the back, this would be very useful for making occlusion cards using pdf

I am not sure I understand, do you mean something like this?

  • Page 1 and 2 make front and back of one note
  • Page 3 and 4 make front and back of a second note
  • Etc

When you say “occlusion cards”, do you mean image occlusions? Or something else?

sorry for not being clear:
using image occlusion add-on takes too long for me to make the cards that I want;

what I do is take the professors pdf slides convert them to images and hide the important parts, keywords, definitions, etc…

But when I use image occlusion add-on it takes a very long time to hide all the text I need hide(I have to do about 400 slides for 8 subjects each semester), so what I want to be able to do is the following:

  1. I have a pdf reader on my iPad called “documents by reddle”
  2. I open pdf on iPad using it
  3. highlight in black the text I want to hide (using iPad would be 10x faster then using image occlusion add-on to hide the text)
  4. Open anki on my pc and have the original pdf and the pdf with hidden text
  5. add the pdf to your addon and the addon makes them into flashcards( the details are below)

idea/ feature 1:
one PDF: page 1 front page 2 back, page 3 front page 4 back (like you said)

idea/ feature 2:



pdf1 on the right pdf2 on the left
two PDFs:
Card #1
(pdf1 page 1) front
(pdf2 page 1) back
Card #2
(pdf1 page 2) front
(pdf2 page 2) back

(meaning that all the front of all the cards will be from pdf1 and all the back of the cards will be from pdf2)

I have one pdf that is normal and a second pdf that I have covered some text from, I want to be able to use one pdf as the front part of the cards and one as the back part of the cards, (idea 1)

or I have a way to merge these pdfs in an alternating fashion (its an online tool) (I have page 1 pdf 1 and then page 1 pdf 2, page 2 pdf 1 page 2 pdf 2) so i can just use one pdf even number being front and odd number the back (idea 2)

I will screen shot of a merged pdf for you to see what i mean for idea 1 if you didn’t understand it

it would be best to make both the ideas so people can use idea 1 or 2 depending on there situation