Pdf viewer [Official Support Thread]

If you have a problem with the add-on pdf viewer post in this thread. This way I get notified. If you make a new thread I will likely miss it.

sometimes when i click the link nothing happens even though the file name matches the one in the folder. what is causing this behavior ? i’m using Anki 2.1.33 (thank you very much)

just for future reference: the bug imeed166 reported is discussed at https://github.com/ijgnd/anki__pdf_viewer_with_pdfjs/issues/3

Hi! I will start by saying that I am a big fan of this add-on, and there hesitate to switch to an alternative. The problem I’m facing is that when I open a pdf link in an anki card, the pdf document won’t load (i.e. the pdf reader is completely white). I have tried to re-install it etc, but unfortunately nothing has worked so far.

@Swedennut : I need more info. Read When problems occur / Problems / Knowledge Base - AnkiMobile/AnkiWeb Support Could you report the following info:

  • I assume this applies to all your pdfs (and not just one)
  • disable all other add-ons and restart and try again.
  • when did the problem start? I updated the add-on about 10 days ago. Anki tries to update add-ons once a day. So if you use Anki regularly you should have been offered an update for my add-on about 9 days ago. Did it work after this?
  • I’d reset the config and manually redo it (or if you have a proper backup of all your user data on your computer with real backu software) restore the config from a backup, see Managing Files - Anki Manual
  • Did you recently update Anki or install or update other add-ons?
  • If you have a proper backup you could delete my most recent version of my add-on and then restore the old version of my add-on (when it was known to work) from your backups and restart and try again.

Absolutely! I’ve tried the steps mentioned in the guide, but unfortunately the problem still remains.

  • Yes, it applies to every pdf
  • Sadly disabling the other add-ons did not solve the problem
  • According to my review history it happened at 28 september, to my memory the bug appeared after updating the add-on!
  • I ran Anki 2.1.44 when the prblem appeard, i have since updated to 2.1.48 in the hope that the problem would disappear

Unfortunately I do not have a proper back-up!
I hope this information helps! :slight_smile:

I’ve published some versions of my addon at Release some versions · ijgnd/anki__pdf_viewer_with_pdfjs · GitHub

319501851__2021-07-11___pdf.viewer.ankiaddon is the file that was on ankiweb after 2021-07-11. If this version does not work for you I have no idea where the problem lies with my add-on.

the file 319501851__2021-09-26___pdf.viewer.ankiaddon is the version that I had on ankiweb for two weeks in September/October 2021 that has two changes: some changes to my code and a new version of the mozilla pdfjs pdf-viewer. In mid October 2021 I removed it from ankiweb because it didn’t work for multiple people.

If the new version crated the problem it could be that the problem is with my code changes or that for some reason your pdf doesn’t work with the new bundled pdf viewer version.

So I made a third package: 319501851__2021-07-11___pdf.viewer____my_july_code_with_new_pdf_viewer_from_2021-09-26_version.ankiaddon That’s my old code with the new viewer. Could you try with this package: Does it work for you?

After installing restart you computer. When Anki checks for updates once a day it will probably want to overwrite this old version of the add-on. You should be able to trick anki by changing this line in this file anki__pdf_viewer_with_pdfjs/manifest.json at b915635bfc385b81f55107a12f179082ca14e574 · ijgnd/anki__pdf_viewer_with_pdfjs · GitHub to another number.

1 Like

Hi, I really appreciate your help, but it seems like the links you posted does not work (I’m directed to a 404 page), I have a theory, it may be because the tags are set to private (if that is possible on Github), I can’t see any published tags at all!

@Swedennut: I’ve updated the links in my post from yesterday.

I’ve now tried the three packages, the first one worked :slight_smile: And i really want to thank you, this is probably the best support regarding a technical issue that I have ever got! :slight_smile:

Regarding the other two packages, neither of them worked, it seems, from my point of view, that the fault lies in the new update of the pdf viewer. I am of couse willing to test further updates to this add-on if you want make sure that this (or similar) problems does not exist.
Thanks again for your help :slight_smile:

thanks for the kind words.

I’m still wondering why this is happening since all the pdfs I tested work in the most recent version for me.

when a new version of pdfjs is released I’ll bundle it and add some extra code for debugging that I’ll send you.

1 Like

Only I find A white page

EDIT:- thanks a bunch
I read a whole thread and find the solution

i deleted the ADDon and operate this version [319501851__2021-07-11___pdf.viewer.ankiaddon]

and everything is being OK

@hassan19 : thanks for the info. Now I have two reports that my version from two weeks ago is broken. So I reverted the ankiweb listing back to the version from july that you reported as working. Anki will report to you in the next 24hours that a new version is available (because ankiweb detected that Iuploaded a file after you installed yours) which should be the same version you already have.

Let me know if the “updated” version (which is actually the old version from July) causes problems for you (which I don’t expect).

1 Like

hallo,Sir
I hope that you are at the best

the last update totally ok.

Much appreciated.

Hi, @ijgnd
I prepared this little contribution for the growing popularity of this great ADDon.
because this helpful ADDon makes my study easier and saves time for Adding Cards and Notes.

Is there a way that the pdf viewer will not turn the text into dark mode for me?

Edit: I found the solution.

Change the definition in the first line to false
"apply night mode hacks to invert colors by default": false,

Or alternatively, how can I set it to open Chrome’s built-in viewer?

set "use pdfjs to show pdfs in Anki 2.1.50+ (with pyqt6)" to false

Note: then you are not using the chrome pdf viewer, i.e. view the pdf in the program chrome. You still only get an additional anki window. It’s just that this window uses a tool to show the pdf that from a technical point of view is closely related to the software that chrome uses. This does not mean that it offers exactly the same functionality.

1 Like

Thank you for this plugin! Very useful for me.
Is it possible to adapt it to this plugin as well?

That is: that when the notes are presented live, it will be possible to click on the pdf link. At the moment it is not possible

it should be possible and I see that this can be useful but I wouldn’t use this feature and I don’t have time so I won’t implement this myself.